From 373fb99a7fa6271178da3d014d5f35cc5ca4c0a8 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 4 Aug 2013 23:02:15 -0400 Subject: [PATCH 1/3] Bugfix: exif_read_data() Incorrect APP1 Exif Identifier Code --- inc/image.php | 2 +- post.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/image.php b/inc/image.php index 920cf8f9..9c4bbef4 100644 --- a/inc/image.php +++ b/inc/image.php @@ -371,7 +371,7 @@ class ImageConvert extends ImageBase { // For when -auto-orient doesn't exist (older versions) static public function jpeg_exif_orientation($src, $exif = false) { if (!$exif) { - $exif = exif_read_data($src); + $exif = @exif_read_data($src); if (!isset($exif['Orientation'])) return false; } diff --git a/post.php b/post.php index 09819ed3..11d9a581 100644 --- a/post.php +++ b/post.php @@ -452,7 +452,7 @@ if (isset($_POST['delete'])) { // 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['redraw_image'] || (($config['strip_exif'] && !$config['use_exiftool']) && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')))) { if (in_array($config['thumb_method'], array('convert', 'convert+gifsicle', 'gm', 'gm+gifsicle'))) { - $exif = exif_read_data($upload); + $exif = @exif_read_data($upload); $gm = in_array($config['thumb_method'], array('gm', 'gm+gifsicle')); if (isset($exif['Orientation']) && $exif['Orientation'] != 1) { if ($config['convert_manual_orient']) { From c9fe458152c9fa3ceccc635a8ce3dafc069885c6 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 4 Aug 2013 23:05:20 -0400 Subject: [PATCH 2/3] exiftool: -ignoreMinorErrors --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index 11d9a581..768199a8 100644 --- a/post.php +++ b/post.php @@ -528,7 +528,7 @@ if (isset($_POST['delete'])) { if ($config['redraw_image'] || (!@$post['exif_stripped'] && $config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) { if (!$config['redraw_image'] && $config['use_exiftool']) { - if($error = shell_exec_error('exiftool -q -all= ' . escapeshellarg($upload))) + if($error = shell_exec_error('exiftool -ignoreMinorErrors -q -all= ' . escapeshellarg($upload))) error('Could not strip EXIF metadata!', null, $error); } else { $image->to($post['file']); From f1e3c53d8d504cfd2ad34b948462f0486c02cc65 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 4 Aug 2013 23:15:01 -0400 Subject: [PATCH 3/3] exiftool: -q needed twice to suppress warning messages --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index 768199a8..ab4775eb 100644 --- a/post.php +++ b/post.php @@ -528,7 +528,7 @@ if (isset($_POST['delete'])) { if ($config['redraw_image'] || (!@$post['exif_stripped'] && $config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) { if (!$config['redraw_image'] && $config['use_exiftool']) { - if($error = shell_exec_error('exiftool -ignoreMinorErrors -q -all= ' . escapeshellarg($upload))) + if($error = shell_exec_error('exiftool -ignoreMinorErrors -q -q -all= ' . escapeshellarg($upload))) error('Could not strip EXIF metadata!', null, $error); } else { $image->to($post['file']);