From 40ab2e0c1728fab613bc16a19ab8fcb3fa78c1d4 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 21:28:16 -0400 Subject: Don't redraw image again after correcting image orientation; Correct image orientation with convert+gifsicle too --- post.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'post.php') diff --git a/post.php b/post.php index 22782ca7..5031830f 100644 --- a/post.php +++ b/post.php @@ -450,10 +450,12 @@ if (isset($_POST['delete'])) { if ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg') { // The following code corrects the image orientation. // Currently only works with the 'convert' option selected but it could easily be expanded to work with the rest if you can be bothered. - if ($config['thumb_method'] == 'convert') { - $exif = exif_read_data($upload); - if (isset($exif['Orientation']) && $exif['Orientation'] != 1) { - shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload)); + if (!($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')))) { + if ($config['thumb_method'] == 'convert' || $config['thumb_method'] == 'convert+gifsicle') { + $exif = exif_read_data($upload); + if (isset($exif['Orientation']) && $exif['Orientation'] != 1) { + shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload)); + } } } } -- cgit v1.3