1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-30 18:24:29 +01:00

Fix files not being saved in certain cases (#483)

This commit is contained in:
370chan 2022-08-20 19:24:46 +03:00 committed by GitHub
parent b5eee58b96
commit c170bc7ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -967,6 +967,8 @@ if (isset($_POST['delete'])) {
$thumb->_destroy(); $thumb->_destroy();
} }
$dont_copy_file = false;
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= ' .
@ -988,6 +990,7 @@ if (isset($_POST['delete'])) {
$config['file_icons'][$file['extension']] : $config['file_icons']['default'])); $config['file_icons'][$file['extension']] : $config['file_icons']['default']));
$file['thumbwidth'] = $size[0]; $file['thumbwidth'] = $size[0];
$file['thumbheight'] = $size[1]; $file['thumbheight'] = $size[1];
$dont_copy_file = false;
} }
if ($config['tesseract_ocr'] && $file['thumb'] != 'file') { // Let's OCR it! if ($config['tesseract_ocr'] && $file['thumb'] != 'file') { // Let's OCR it!
@ -1018,7 +1021,7 @@ if (isset($_POST['delete'])) {
} }
} }
if (!isset($dont_copy_file) || !$dont_copy_file) { if (!$dont_copy_file) {
if (isset($file['file_tmp'])) { if (isset($file['file_tmp'])) {
if (!@rename($file['tmp_name'], $file['file'])) if (!@rename($file['tmp_name'], $file['file']))
error($config['error']['nomove']); error($config['error']['nomove']);