Save workspace changes

This commit is contained in:
2026-04-18 17:02:56 +02:00
parent f02ea9a711
commit 87d60af5a9
4220 changed files with 1388603 additions and 1554 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Services\Vision;
use App\Models\Artwork;
use App\Services\ThumbnailService;
final class ArtworkVisionImageUrl
{
public function fromArtwork(Artwork $artwork): ?string
{
return $this->fromHash(
(string) ($artwork->hash ?? ''),
(string) ($artwork->thumb_ext ?: 'webp')
);
}
public function fromHash(?string $hash, ?string $ext = 'webp', string $size = 'md'): ?string
{
$clean = strtolower((string) preg_replace('/[^a-z0-9]/', '', (string) $hash));
if ($clean === '') {
return null;
}
return ThumbnailService::fromHash($clean, $ext, $size);
}
}