summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
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 3c3d6e62..c355eca6 100644
--- a/post.php
+++ b/post.php
@@ -455,8 +455,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);
}