]> BookStack Code Mirror - bookstack/blobdiff - app/Services/ImageService.php
Merge branch 'patch-1' of git://github.com/younes0/BookStack into younes0-patch-1
[bookstack] / app / Services / ImageService.php
index 331a407c3daf2a24d658c0c751b38d6cfd6065b2..f645a06a5b71415622bbeff85515db2a352e5d02 100644 (file)
@@ -95,6 +95,7 @@ class ImageService
 
         try {
             $storage->put($fullPath, $imageData);
+            $storage->setVisibility($fullPath, 'public');
         } catch (Exception $e) {
             throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
         }
@@ -167,6 +168,7 @@ class ImageService
 
         $thumbData = (string)$thumb->encode();
         $storage->put($thumbFilePath, $thumbData);
+        $storage->setVisibility($thumbFilePath, 'public');
         $this->cache->put('images-' . $image->id . '-' . $thumbFilePath, $thumbFilePath, 60 * 72);
 
         return $this->getPublicUrl($thumbFilePath);