forked from leftypol/leftypol
Don't redraw image again after correcting image orientation; Correct image orientation with convert+gifsicle too
This commit is contained in:
parent
6c41037377
commit
40ab2e0c17
2 changed files with 8 additions and 6 deletions
10
post.php
10
post.php
|
@ -450,10 +450,12 @@ if (isset($_POST['delete'])) {
|
|||
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));
|
||||
if (!($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')))) {
|
||||
if ($config['thumb_method'] == 'convert' || $config['thumb_method'] == 'convert+gifsicle') {
|
||||
$exif = exif_read_data($upload);
|
||||
if (isset($exif['Orientation']) && $exif['Orientation'] != 1) {
|
||||
shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue