Merge pull request #144 from younes0/patch-2

set uploaded images visibility public (relevant for S3 storage)
This commit is contained in:
Dan Brown 2016-07-10 10:14:19 +01:00 committed by GitHub
commit 0ebdfa4825

View 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);
@ -269,4 +271,4 @@ class ImageService
}
}
}