From b1629a33e9c743df17a379e67495b6fdc30aeb15 Mon Sep 17 00:00:00 2001 From: discomrade Date: Sun, 27 Jun 2021 23:41:47 -0200 Subject: [PATCH] Fix thumb_ext being ignored When using ImageMagick's convert tool, the output defaults to the input format if no file extension or format is specified. The temp file currently has no extension, so a $config['thumb_ext'] value has no effect on the image. By appending the thumb_ext to the temp output file, it will convert the image to the intended format. --- inc/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/image.php b/inc/image.php index c9c35736..a3697e70 100644 --- a/inc/image.php +++ b/inc/image.php @@ -311,7 +311,7 @@ class ImageConvert extends ImageBase { $this->destroy(); } - $this->temp = tempnam($config['tmp'], 'convert'); + $this->temp = tempnam($config['tmp'], 'convert') . ($config['thumb_ext'] == '' ? '' : '.' . $config['thumb_ext']); $config['thumb_keep_animation_frames'] = (int)$config['thumb_keep_animation_frames'];