summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-03 22:18:46 -0400
committerczaks <marcin@6irc.net>2013-08-03 22:18:46 -0400
commitf128811dd339c721b71956dea3c4798b6ef9438a (patch)
tree00dc194e5593899ffec0fb1caa1fa451eef70c0f /post.php
parentddcad35f6ca434c8082e29db9ad92daab385a6ef (diff)
parentde62cced6fe1b7b158be34f1cc4d53d7527518b2 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Diffstat (limited to 'post.php')
-rw-r--r--post.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/post.php b/post.php
index cfae69b7..a6ed55e6 100644
--- a/post.php
+++ b/post.php
@@ -457,8 +457,16 @@ if (isset($_POST['delete'])) {
$exif = exif_read_data($upload);
$gm = in_array($config['thumb_method'], array('gm', 'gm+gifsicle'));
if (isset($exif['Orientation']) && $exif['Orientation'] != 1) {
- if($error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' .
- escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload)))
+ if ($config['convert_manual_orient']) {
+ $error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' .
+ escapeshellarg($upload) . ' ' .
+ ImageConvert::jpeg_exif_orientation(false, $exif) . ' +profile "*" ' .
+ escapeshellarg($upload));
+ } else {
+ $error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' .
+ escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload));
+ }
+ if ($error)
error('Could not auto-orient image!', null, $error);
$size = @getimagesize($upload);
}