return;
}
- $adapter->loadFile($file->getLocation());
+ try {
+ $adapter->loadFile($file->getLocation());
+ } catch (\Exception $e) {
+ \wcf\functions\exception\logThrowable($e);
+
+ return;
+ }
$updateData = [];
foreach ($this->options['thumbnailSizes'] as $type => $sizeData) {
}
if ($file->width > $sizeData['width'] || $file->height > $sizeData['height']) {
- $thumbnail = $adapter->createThumbnail(
- $sizeData['width'],
- $sizeData['height'],
- $sizeData['retainDimensions'] ?? true
- );
+ try {
+ $thumbnail = $adapter->createThumbnail(
+ $sizeData['width'],
+ $sizeData['height'],
+ $sizeData['retainDimensions'] ?? true
+ );
+ } catch (\Exception $e) {
+ \wcf\functions\exception\logThrowable($e);
+
+ continue;
+ }
+
$adapter->writeImage($thumbnail, $thumbnailLocation);
// Clear thumbnail as soon as possible to free up the memory for the next size.
$thumbnail = null;