Better Handling for Broken Image Files

This commit is contained in:
seiichiro 2022-07-12 07:51:16 +00:00
parent 933942045f
commit d54027beeb

View file

@ -54,6 +54,11 @@ class thumb {
$image = call_user_func(self::IMAGE_HANDLERS[$type]['load'], $src); $image = call_user_func(self::IMAGE_HANDLERS[$type]['load'], $src);
if ($image == false) {
error_log("$src: Image Loading Failed");
return "img/error.png";
}
$srcwidth = imagesx($image); $srcwidth = imagesx($image);
$srcheight = imagesy($image); $srcheight = imagesy($image);