mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Support converting BMP and WEBP images to JPG
This commit is contained in:
parent
62eb21abbb
commit
bf93afd7e5
7 changed files with 95 additions and 17 deletions
|
|
@ -527,6 +527,12 @@ class FileHandler
|
|||
case '6' :
|
||||
$type = 'bmp';
|
||||
break;
|
||||
case '8' :
|
||||
$type = 'wbmp';
|
||||
break;
|
||||
case '18' :
|
||||
$type = 'webp';
|
||||
break;
|
||||
default :
|
||||
return;
|
||||
}
|
||||
|
|
@ -603,13 +609,24 @@ class FileHandler
|
|||
$source = @imagecreatefrompng($source_file);
|
||||
}
|
||||
break;
|
||||
case 'wbmp' :
|
||||
case 'bmp' :
|
||||
if(function_exists('imagecreatefrombmp'))
|
||||
{
|
||||
$source = @imagecreatefrombmp($source_file);
|
||||
}
|
||||
break;
|
||||
case 'wbmp' :
|
||||
if(function_exists('imagecreatefromwbmp'))
|
||||
{
|
||||
$source = @imagecreatefromwbmp($source_file);
|
||||
}
|
||||
break;
|
||||
case 'webp' :
|
||||
if(function_exists('imagecreatefromwebp'))
|
||||
{
|
||||
$source = @imagecreatefromwebp($source_file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$source)
|
||||
|
|
@ -665,13 +682,24 @@ class FileHandler
|
|||
$output = imagepng($thumb, $target_file, 9);
|
||||
}
|
||||
break;
|
||||
case 'wbmp' :
|
||||
case 'bmp' :
|
||||
if(function_exists('imagebmp'))
|
||||
{
|
||||
$output = imagebmp($thumb, $target_file, 100);
|
||||
}
|
||||
break;
|
||||
case 'wbmp' :
|
||||
if(function_exists('imagewbmp'))
|
||||
{
|
||||
$output = imagewbmp($thumb, $target_file, 100);
|
||||
}
|
||||
break;
|
||||
case 'webp' :
|
||||
if(function_exists('imagewebp'))
|
||||
{
|
||||
$output = imagewebp($thumb, $target_file, 100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
imagedestroy($thumb);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue