Implement creator studio and upload updates
This commit is contained in:
@@ -17,13 +17,18 @@ class ThumbnailService
|
||||
return rtrim((string) config('cdn.files_url', 'https://files.skinbase.org'), '/');
|
||||
}
|
||||
|
||||
protected static function artworkPrefix(): string
|
||||
{
|
||||
return trim((string) config('uploads.object_storage.prefix', 'artworks'), '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Canonical size keys: xs · sm · md · lg · xl (+ legacy thumb/sq support).
|
||||
*/
|
||||
protected const VALID_SIZES = ['xs', 'sm', 'md', 'lg', 'xl', 'thumb', 'sq'];
|
||||
|
||||
/** Size aliases for backwards compatibility with old callers. */
|
||||
protected const SIZE_ALIAS = [];
|
||||
protected const SIZE_ALIAS = ['thumb' => 'sm'];
|
||||
|
||||
protected const THUMB_SIZES = [
|
||||
'xs' => ['height' => 160, 'quality' => 74, 'dir' => 'xs'],
|
||||
@@ -33,7 +38,7 @@ class ThumbnailService
|
||||
'lg' => ['height' => 1920, 'quality' => 85, 'dir' => 'lg'],
|
||||
'xl' => ['height' => 2560, 'quality' => 90, 'dir' => 'xl'],
|
||||
// Legacy compatibility for older paths still expecting /thumb/.
|
||||
'thumb' => ['height' => 320, 'quality' => 78, 'dir' => 'thumb'],
|
||||
'thumb' => ['height' => 320, 'quality' => 78, 'dir' => 'sm'],
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -94,7 +99,7 @@ class ThumbnailService
|
||||
$h = $hash;
|
||||
$h1 = substr($h, 0, 2);
|
||||
$h2 = substr($h, 2, 2);
|
||||
return sprintf('%s/%s/%s/%s/%s.%s', self::cdnHost(), $dir, $h1, $h2, $h, $ext);
|
||||
return sprintf('%s/%s/%s/%s/%s.%s', self::cdnHost(), self::artworkPrefix() . '/' . $dir, $h1, $h2, $h, $ext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user