Fix Gif Thumbnail Handler
This commit is contained in:
parent
e4b3b73d39
commit
391e946ea8
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue