Prevent the generation of thumbnails for small images
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / file / processor / FileProcessor.class.php
index fe6639b445770d5b58067c0c1eb0daf2987a5d14..2ffb4e40cf39a0240c29daa299cef16ffa599824 100644 (file)
@@ -102,6 +102,12 @@ final class FileProcessor extends SingletonFactory
                 continue;
             }
 
+            // Check if we the source image is larger than the dimensions of the
+            // requested thumbnails.
+            if ($format->width > $file->width && $format->height > $file->height) {
+                continue;
+            }
+
             if ($imageAdapter === null) {
                 $imageAdapter = ImageHandler::getInstance()->getAdapter();
                 $imageAdapter->loadFile($file->getPathname());