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