1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Some logic fixes. Don't strip exif twice.

This commit is contained in:
Michael Foster 2013-08-04 00:54:27 -04:00
parent 0387ae1b46
commit a2b432cfb0

View File

@ -459,9 +459,11 @@ if (isset($_POST['delete'])) {
$error = shell_exec_error(($gm ? 'gm ' : '') . 'convert ' .
escapeshellarg($upload) . ' ' .
ImageConvert::jpeg_exif_orientation(false, $exif) . ' ' .
($config['strip_exif'] ? '+profile "*"' : ($config['use_exiftool'] ? '' : '+profile "*"')) . ' ' .
($config['strip_exif'] ? '+profile "*"' :
($config['use_exiftool'] ? '' : '+profile "*"')
) . ' ' .
escapeshellarg($upload));
if ($config['use_exiftool']) {
if ($config['use_exiftool'] && !$config['strip_exif']) {
if ($exiftool_error = shell_exec_error(
'exiftool -q -orientation=1 -n ' . escapeshellarg($upload)))
error('exiftool failed!', null, $exiftool_error);
@ -476,6 +478,8 @@ if (isset($_POST['delete'])) {
if ($error)
error('Could not auto-orient image!', null, $error);
$size = @getimagesize($upload);
if ($config['strip_exif'])
$post['exif_stripped'] = true;
}
}
}
@ -522,7 +526,7 @@ if (isset($_POST['delete'])) {
$thumb->_destroy();
}
if ($config['redraw_image'] || ($config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) {
if ($config['redraw_image'] || (!@$post['exif_stripped'] && $config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg'))) {
if (!$config['redraw_image'] && $config['use_exiftool']) {
if($error = shell_exec_error('exiftool -q -all= ' . escapeshellarg($upload)))
error('Could not strip EXIF metadata!', null, $error);