diff --git a/composer.lock b/composer.lock index d2b6b78..1a7e001 100644 --- a/composer.lock +++ b/composer.lock @@ -797,16 +797,16 @@ }, { "name": "intervention/image", - "version": "4.0.4", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed" + "reference": "fb795553f76afbe55c80d32b6bfe2090a6b1a0af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed", - "reference": "f58d379b1f13c036b2ef5c3c26eb4b0c88b647ed", + "url": "https://api.github.com/repos/Intervention/image/zipball/fb795553f76afbe55c80d32b6bfe2090a6b1a0af", + "reference": "fb795553f76afbe55c80d32b6bfe2090a6b1a0af", "shasum": "" }, "require": { @@ -853,7 +853,7 @@ ], "support": { "issues": "https://github.com/Intervention/image/issues", - "source": "https://github.com/Intervention/image/tree/4.0.4" + "source": "https://github.com/Intervention/image/tree/4.1.0" }, "funding": [ { @@ -869,7 +869,7 @@ "type": "ko_fi" } ], - "time": "2026-05-03T04:47:13+00:00" + "time": "2026-05-15T06:52:36+00:00" }, { "name": "laravel/framework", diff --git a/src/Commands/RebuildThumbnails.php b/src/Commands/RebuildThumbnails.php index 785576a..1af2218 100644 --- a/src/Commands/RebuildThumbnails.php +++ b/src/Commands/RebuildThumbnails.php @@ -27,8 +27,8 @@ class RebuildThumbnails extends Command $files = FileRepo::query()->get(); $disk = $this->fileService->loadPublicDisk(); foreach ($files as $file) { - $this->fileService->createTemplates($disk, $file->path); try { + $this->fileService->createTemplates($disk, $file->path); } catch (Exception $e) { $this->error( "File " . $file->filename . " could not be rebuilt \n", diff --git a/src/File/FileService.php b/src/File/FileService.php index d20f418..026cb6a 100644 --- a/src/File/FileService.php +++ b/src/File/FileService.php @@ -4,6 +4,7 @@ namespace Lucent\File; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Http\UploadedFile; +use Illuminate\Log\Logger; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Intervention\Image\Format; @@ -19,6 +20,7 @@ class FileService public function __construct( public ChannelService $channelService, public ImageManager $imageManager, + public Logger $logger, ) {} public function createFromUrl( @@ -126,8 +128,14 @@ class FileService public function createTemplates(Filesystem $disk, string $path): void { + $filePath = "lucent/" . $path; + + if (!$this->loadPublicDisk()->exists($filePath)) { + return; + } + $originalImage = $this->imageManager->decode( - $this->loadPublicDisk()->get("lucent/" . $path), + $this->loadPublicDisk()->get($filePath), ); foreach ($this->channelService->channel->imageFilters as $filterClass) { $imageClone = clone $originalImage;