Remove other unnecessary function checks

This commit is contained in:
Kijin Sung 2021-01-19 14:45:32 +09:00
parent adb6203f1b
commit 015238d75f

View file

@ -638,7 +638,7 @@ class FileHandler
return FALSE; return FALSE;
} }
if($target_type == 'png' && function_exists('imagecolorallocatealpha') && function_exists('imagesavealpha') && function_exists('imagealphablending')) if($target_type == 'png')
{ {
imagefill($thumb, 0, 0, imagecolorallocatealpha($thumb, 0, 0, 0, 127)); imagefill($thumb, 0, 0, imagecolorallocatealpha($thumb, 0, 0, 0, 127));
imagesavealpha($thumb, TRUE); imagesavealpha($thumb, TRUE);
@ -661,15 +661,8 @@ class FileHandler
$y = (int) ($resize_height / 2 - $new_height / 2); $y = (int) ($resize_height / 2 - $new_height / 2);
} }
if(function_exists('imagecopyresampled'))
{
imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height); imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
} }
else
{
imagecopyresized($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
}
}
// create directory // create directory
self::makeDir(dirname($target_file)); self::makeDir(dirname($target_file));