- protected static $supportedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
-
- /**
- * ImageService constructor.
- */
- public function __construct(Image $image, ImageManager $imageTool, FileSystem $fileSystem, Cache $cache)
- {
- $this->image = $image;
- $this->imageTool = $imageTool;
- $this->fileSystem = $fileSystem;
- $this->cache = $cache;
- }
-
- /**
- * Get the storage that will be used for storing images.
- */
- protected function getStorageDisk(string $imageType = ''): FileSystemInstance
- {
- return $this->fileSystem->disk($this->getStorageDiskName($imageType));
- }
-
- /**
- * Check if local secure image storage (Fetched behind authentication)
- * is currently active in the instance.
- */
- protected function usingSecureImages(): bool
- {
- return $this->getStorageDiskName('gallery') === 'local_secure_images';
- }
-
- /**
- * Change the originally provided path to fit any disk-specific requirements.
- * This also ensures the path is kept to the expected root folders.
- */
- protected function adjustPathForStorageDisk(string $path, string $imageType = ''): string
- {
- $path = Util::normalizePath(str_replace('uploads/images/', '', $path));
-
- if ($this->getStorageDiskName($imageType) === 'local_secure_images') {
- return $path;
- }
-
- return 'uploads/images/' . $path;
- }
-
- /**
- * Get the name of the storage disk to use.
- */
- protected function getStorageDiskName(string $imageType): string
- {
- $storageType = config('filesystems.images');
-
- // Ensure system images (App logo) are uploaded to a public space
- if ($imageType === 'system' && $storageType === 'local_secure') {
- $storageType = 'local';
- }
-
- if ($storageType === 'local_secure') {
- $storageType = 'local_secure_images';
- }
-
- return $storageType;
+ public function __construct(
+ protected ImageStorage $storage,
+ protected ImageResizer $resizer,
+ protected EntityQueries $queries,
+ ) {