]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageService.php
ZIP Imports: Started testing core import logic
[bookstack] / app / Uploads / ImageService.php
index 5c455cf86336b346b7e53e9647b7f7ee52e23e2d..038e6aa417c839b8f794038ec2bd40545f71e111 100644 (file)
@@ -33,9 +33,10 @@ class ImageService
         int $uploadedTo = 0,
         int $resizeWidth = null,
         int $resizeHeight = null,
-        bool $keepRatio = true
+        bool $keepRatio = true,
+        string $imageName = '',
     ): Image {
-        $imageName = $uploadedFile->getClientOriginalName();
+        $imageName = $imageName ?: $uploadedFile->getClientOriginalName();
         $imageData = file_get_contents($uploadedFile->getRealPath());
 
         if ($resizeWidth !== null || $resizeHeight !== null) {