summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-04 00:54:27 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-04 00:54:27 -0400
commita2b432cfb08c75159f73e2112be600cb5c0a4ef1 (patch)
tree321c95bb26d640e08f55d7fb74188e92883d8fe1
parent0387ae1b46c62bc977172fd1c35f9684461e73d6 (diff)
Some logic fixes. Don't strip exif twice.
-rw-r--r--post.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/post.php b/post.php
index b159361a..09819ed3 100644
--- a/post.php
+++ b/post.php
@@ -459,9 +459,11 @@ if (isset($_POST['delete'])) {
$error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' .
escapeshellarg($upload) . ' ' .
ImageConvert::jpeg_exif_orientation(false, $exif) . ' ' .
- ($config['strip_exif'] ? '+profile "*"' : ($config['use_exiftool'] ? '' : '+profile "*"')) . ' ' .
+ ($config['strip_exif'] ? '+profile "*"' :
+ ($config['use_exiftool'] ? '' : '+profile "*"')
+ ) . ' ' .
escapeshellarg($upload));
- if ($config['use_exiftool']) {
+ if ($config['use_exiftool'] && !$config['strip_exif']) {
if ($exiftool_error = shell_exec_error(
'exiftool -q -orientation=1 -n ' . escapeshellarg($upload)))
error('exiftool failed!', null, $exiftool_error);
@@ -476,6 +478,8 @@ if (isset($_POST['delete'])) {
if ($error)
error('Could not auto-orient image!', null, $error);
$size = @getimagesize($upload);
+ if ($config['strip_exif'])
+ $post['exif_stripped'] = true;
}
}
}
@@ -522,7 +526,7 @@ if (isset($_POST['delete'])) {
$thumb->_destroy();
}
- if ($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) {
+ 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)))
error('Could not strip EXIF metadata!', null, $error);