This commit is contained in:
Shish
2023-01-11 11:15:26 +00:00
parent 91b354f6f8
commit 5a64e8729b
49 changed files with 99 additions and 112 deletions

View File

@@ -182,7 +182,7 @@ class TranscodeImage extends Extension
$new_image = $this->transcode_image($event->tmpname, $mime, $target_mime);
$event->set_mime($target_mime);
$event->set_tmpname($new_image);
} catch (Exception $e) {
} catch (\Exception $e) {
log_error("transcode", "Error while performing upload transcode: ".$e->getMessage());
// We don't want to interfere with the upload process,
// so if something goes wrong the untranscoded image jsut continues
@@ -295,11 +295,11 @@ class TranscodeImage extends Extension
$database->commit();
$total++;
$size_difference += ($before_size - $new_image->filesize);
} catch (Exception $e) {
} catch (\Exception $e) {
log_error("transcode", "Error while bulk transcode on item {$image->id} to $mime: ".$e->getMessage());
try {
$database->rollback();
} catch (Exception $e) {
} catch (\Exception $e) {
// is this safe? o.o
}
}