Show error when ImageMagick is enabled but is not installed

This commit is contained in:
Trevor Slocum 2020-08-18 18:51:32 -07:00
parent 62f2797f4e
commit 7f05618811

View File

@ -506,8 +506,15 @@ function createThumbnail($file_location, $thumb_location, $new_w, $new_h) {
imagedestroy($dst_img); imagedestroy($dst_img);
imagedestroy($src_img); imagedestroy($src_img);
} else { // imagemagick } else { // ImageMagick
$discard = ''; $discard = '';
$exit_status = 1;
exec("convert -version", $discard, $exit_status);
if ($exit_status != 0) {
fancyDie('ImageMagick is not installed, or the convert command is not in the server\'s $PATH.<br>Install ImageMagick, or set TINYIB_THUMBNAIL to \'gd\'.');
}
$exit_status = 1; $exit_status = 1;
exec("convert $file_location -auto-orient -thumbnail '" . $new_w . "x" . $new_h . "' -coalesce -layers OptimizeFrame -depth 4 -type palettealpha $thumb_location", $discard, $exit_status); exec("convert $file_location -auto-orient -thumbnail '" . $new_w . "x" . $new_h . "' -coalesce -layers OptimizeFrame -depth 4 -type palettealpha $thumb_location", $discard, $exit_status);