Added ability to secure images behind auth

Still in testing.
Adds STORAGE_TYPE=local_secure option for setting images to be behind
auth. Stores images alongside attachments in /storage/uploads/images.
This commit is contained in:
Dan Brown
2018-01-13 11:11:23 +00:00
parent 6988a6ff88
commit 0afa417b0a
8 changed files with 67 additions and 45 deletions

View File

@ -183,7 +183,6 @@ class ImageRepo
* Get the thumbnail for an image.
* If $keepRatio is true only the width will be used.
* Checks the cache then storage to avoid creating / accessing the filesystem on every check.
*
* @param Image $image
* @param int $width
* @param int $height
@ -194,9 +193,9 @@ class ImageRepo
{
try {
return $this->imageService->getThumbnail($image, $width, $height, $keepRatio);
} catch (FileNotFoundException $exception) {
$image->delete();
return [];
} catch (\Exception $exception) {
dd($exception);
return null;
}
}