Fix Gif Thumbnail Handler

This commit is contained in:
seiichiro 2022-02-03 15:37:54 +01:00
parent e4b3b73d39
commit 391e946ea8

View file

@ -21,7 +21,6 @@ class thumb {
IMAGETYPE_GIF => [ IMAGETYPE_GIF => [
'load' => 'imagecreatefromgif', 'load' => 'imagecreatefromgif',
'save' => 'imagegif', 'save' => 'imagegif',
'quality' => 0
], ],
IMAGETYPE_WEBP => [ IMAGETYPE_WEBP => [
'load' => 'imagecreatefromwebp', 'load' => 'imagecreatefromwebp',
@ -67,7 +66,11 @@ class thumb {
} }
imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $width, $height, $srcwidth, $srcheight); imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $width, $height, $srcwidth, $srcheight);
if ($type != IMAGETYPE_GIF) {
call_user_func(self::IMAGE_HANDLERS[$type]['save'],$thumbnail,$dstpath,self::IMAGE_HANDLERS[$type]['quality']); call_user_func(self::IMAGE_HANDLERS[$type]['save'],$thumbnail,$dstpath,self::IMAGE_HANDLERS[$type]['quality']);
} else {
call_user_func(self::IMAGE_HANDLERS[$type]['save'],$thumbnail,$dstpath);
}
imagedestroy($image); imagedestroy($image);
imagedestroy($thumbnail); imagedestroy($thumbnail);
} }