diff --git a/post.php b/post.php index aba6c6be..8fe7354f 100644 --- a/post.php +++ b/post.php @@ -1055,9 +1055,11 @@ if (isset($_POST['delete'])) { if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) { error($config['error']['maxsize']); } + // If, on the basis of the file extension, the image file has metadata we can operate on. $file_image_has_operable_metadata = $file['extension'] === 'jpg' || $file['extension'] === 'jpeg' || $file['extension'] === 'webp' || $file['extension'] == 'png'; + $file['exif_stripped'] = false; if ($file_image_has_operable_metadata && $config['convert_auto_orient']) { // The following code corrects the image orientation. @@ -1123,7 +1125,7 @@ if (isset($_POST['delete'])) { $dont_copy_file = false; - if ($config['redraw_image'] || ($file_image_has_operable_metadata && !@$file['exif_stripped'] && $config['strip_exif'])) { + if ($config['redraw_image'] || ($file_image_has_operable_metadata && !$file['exif_stripped'] && $config['strip_exif'])) { if (!$config['redraw_image'] && $config['use_exiftool']) { try { $file['size'] = strip_image_metadata($file['tmp_name']);