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 => [
|
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);
|
||||||
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($image);
|
||||||
imagedestroy($thumbnail);
|
imagedestroy($thumbnail);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue