From 010ab2bf62f4759a07358e87320faf0370692ad3 Mon Sep 17 00:00:00 2001 From: fowr <89118232+perdedora@users.noreply.github.com> Date: Fri, 21 Jul 2023 23:26:55 -0300 Subject: [PATCH] post.php: add default exif_stripped --- post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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']);