diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 22:14:25 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-03 22:14:25 -0400 |
| commit | ac4306555bf3bce78401918e23b81e863fcd37fb (patch) | |
| tree | 00353f9c36c6fea15399d9baa1def40dd346876e /post.php | |
| parent | 486eccba2e99888ebc4be77af52b1df54a4645ef (diff) | |
Fix for instances with old GraphicsMagick or ImageMagick versions (no -auto-orient).
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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); } |
