From 49a3277cca34960b959df44d83fbf62f88b72441 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Thu, 8 Oct 2020 17:08:22 -0500 Subject: [PATCH] Fixed imagemagick thumbnailing issue with metadata-rotated images --- ext/media/main.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/media/main.php b/ext/media/main.php index 74d7f0a7..ec644952 100644 --- a/ext/media/main.php +++ b/ext/media/main.php @@ -581,7 +581,7 @@ class Media extends Extension $resize_suffix .= "\!"; } - $args = ""; + $args = " -auto-orient "; $resize_arg = "-resize"; if ($minimize) { $args .= "-strip "; @@ -611,8 +611,8 @@ class Media extends Extension case Media::RESIZE_TYPE_FIT_BLUR: $blur_size = max(ceil(max($new_width, $new_height) / 25), 5); $args .= "${file_arg} ". - "\( -clone 0 -resize ${new_width}x${new_height}\^ -background ${bg} -flatten -gravity center -fill black -colorize 50% -extent ${new_width}x${new_height} -blur 0x${blur_size} \) ". - "\( -clone 0 -resize ${new_width}x${new_height} \) ". + "\( -clone 0 -auto-orient -resize ${new_width}x${new_height}\^ -background ${bg} -flatten -gravity center -fill black -colorize 50% -extent ${new_width}x${new_height} -blur 0x${blur_size} \) ". + "\( -clone 0 -auto-orient -resize ${new_width}x${new_height} \) ". "-delete 0 -gravity center -compose over -composite"; break; }