Add thumbnail
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 18 Dec 2024 10:15:22 +0000 (11:15 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 18 Dec 2024 10:15:22 +0000 (11:15 +0100)
wcfsetup/install/files/lib/action/UserCoverPhotoAction.class.php
wcfsetup/install/files/lib/system/file/processor/UserCoverPhotoFileProcessor.class.php

index 3c1083fdf857edcda627b60ed5618bf903addf80..0f4a1d50df2b2120300f1952f8cbb84da165128d 100644 (file)
@@ -75,6 +75,7 @@ final class UserCoverPhotoAction implements RequestHandlerInterface
                 ->singleFileUpload()
                 ->bigPreview()
                 ->simpleReplace()
+                ->thumbnailSize('small')
         ]);
 
         $form->markRequiredFields(false);
index 1be6643af1c505010738d048d023a289c55cf9fb..b5e7604a6d119c96c7aa54f49de8580f5d6113bf 100644 (file)
@@ -213,4 +213,17 @@ final class UserCoverPhotoFileProcessor extends AbstractFileProcessor
             new ImageCropSize(UserCoverPhoto::MAX_WIDTH, UserCoverPhoto::MAX_HEIGHT)
         );
     }
+
+    #[\Override]
+    public function getThumbnailFormats(): array
+    {
+        return [
+            new ThumbnailFormat(
+                'small',
+                UserCoverPhoto::MIN_HEIGHT,
+                UserCoverPhoto::MIN_WIDTH,
+                false,
+            ),
+        ];
+    }
 }