From 749919de47b5a033bd7eee41d75205c0b10cdc8b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 22 Sep 2023 15:29:59 +0200 Subject: [PATCH] Revert "Prevent attempts to generate thumbnails for underflowing images" This reverts commit 9bac11e57439a075007abe4776eee5c7703da9c1. --- .../upload/DefaultUploadFileSaveStrategy.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php b/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php index 9d53ccad1a..0d8b6d5a66 100644 --- a/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php +++ b/wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php @@ -331,18 +331,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy $updateData[$prefix . 'Height'] = 0; } - // Thumbnails should only be created if at least one side exceeds the - // dimensions of the thumbnail and the other side is at least of equal - // size. This prevents attempts to create a thumbnail of an image that - // underflows the thumbnail dimensions on one side. - $createThumbnail = false; - if ($file->width > $sizeData['width'] && $file->height >= $sizeData['height']) { - $createThumbnail = true; - } else if ($file->height > $sizeData['height'] && $file->width >= $sizeData['width']) { - $createThumbnail = true; - } - - if ($createThumbnail) { + if ($file->width > $sizeData['width'] || $file->height > $sizeData['height']) { try { $thumbnail = $adapter->createThumbnail( $sizeData['width'], -- 2.20.1