mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 16:00:22 +01:00
Don't redraw image again after correcting image orientation; Correct image orientation with convert+gifsicle too
This commit is contained in:
parent
edae661ac2
commit
d71f49c801
@ -251,9 +251,9 @@ class ImageConvert extends ImageBase {
|
|||||||
|
|
||||||
if (!$this->temp) {
|
if (!$this->temp) {
|
||||||
if ($config['strip_exif']) {
|
if ($config['strip_exif']) {
|
||||||
shell_exec('convert ' . escapeshellarg($this->src) . ' -strip ' . escapeshellarg($src));
|
shell_exec('convert ' . escapeshellarg($this->src) . ' -auto-orient -strip ' . escapeshellarg($src));
|
||||||
} else {
|
} else {
|
||||||
shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src));
|
shell_exec('convert ' . escapeshellarg($this->src) . ' -auto-orient ' . escapeshellarg($src));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rename($this->temp, $src);
|
rename($this->temp, $src);
|
||||||
|
10
post.php
10
post.php
@ -450,10 +450,12 @@ if (isset($_POST['delete'])) {
|
|||||||
if ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg') {
|
if ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg') {
|
||||||
// The following code corrects the image orientation.
|
// 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.
|
// 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 (!($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')))) {
|
||||||
$exif = exif_read_data($upload);
|
if ($config['thumb_method'] == 'convert' || $config['thumb_method'] == 'convert+gifsicle') {
|
||||||
if (isset($exif['Orientation']) && $exif['Orientation'] != 1) {
|
$exif = exif_read_data($upload);
|
||||||
shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload));
|
if (isset($exif['Orientation']) && $exif['Orientation'] != 1) {
|
||||||
|
shell_exec('convert ' . escapeshellarg($upload) . ' -auto-orient ' . escapeshellarg($upload));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user