summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-21 15:50:45 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-21 15:50:45 -0400
commit308f557fd503898406d7cb54ef7e6e6efb0f84ae (patch)
treec42fa4b237309168d895aa72d60e3b1b40ffeeac /post.php
parente8b693b0447e5a61f740b27c5f3a57f68d544342 (diff)
Option to automatically strip EXIF metadata from JPEGs
Diffstat (limited to 'post.php')
-rw-r--r--post.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/post.php b/post.php
index 4e10c0cf..4e3a1a9f 100644
--- a/post.php
+++ b/post.php
@@ -420,10 +420,11 @@ if (isset($_POST['delete'])) {
error($config['error']['maxsize']);
}
- // The following code corrects the image orientation based on EXIF.
- // 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') {
- if ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg') {
+
+ 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));
@@ -473,7 +474,7 @@ if (isset($_POST['delete'])) {
$thumb->_destroy();
}
- if ($config['redraw_image']) {
+ if ($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) {
$image->to($post['file']);
$dont_copy_file = true;
}