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

Recalculate filesize after stripping metadata

This commit is contained in:
discomrade 2021-07-06 11:37:54 +00:00 committed by Zankaria
parent 0c3159673d
commit 0cefa9353b

View File

@ -1089,9 +1089,17 @@ if (isset($_POST['delete'])) {
if ($config['redraw_image'] || (!@$file['exif_stripped'] && $config['strip_exif'] && ($file['extension'] == 'jpg' || $file['extension'] == 'jpeg'))) { if ($config['redraw_image'] || (!@$file['exif_stripped'] && $config['strip_exif'] && ($file['extension'] == 'jpg' || $file['extension'] == 'jpeg'))) {
if (!$config['redraw_image'] && $config['use_exiftool']) { if (!$config['redraw_image'] && $config['use_exiftool']) {
if($error = shell_exec_error('exiftool -overwrite_original -ignoreMinorErrors -q -q -all= ' . if ($error = shell_exec_error('exiftool -overwrite_original -ignoreMinorErrors -q -q -all= ' .
escapeshellarg($file['tmp_name']))) escapeshellarg($file['tmp_name']))) {
error(_('Could not strip EXIF metadata!'), null, $error); error(_('Could not strip EXIF metadata!'), null, $error);
} else {
clearstatcache(true, $file['tmp_name']);
$ret = filesize($file['tmp_name']);
if ($ret === false) {
error(_('Could not calculate file size!'), null, $error);
}
$file['size'] = $ret;
}
} else { } else {
$image->to($file['file']); $image->to($file['file']);
$dont_copy_file = true; $dont_copy_file = true;