import fixed
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user