diff --git a/src/Asset/Controller/Image/CustomStreamController.php b/src/Asset/Controller/Image/CustomStreamController.php index 792ccc83..e20acf30 100644 --- a/src/Asset/Controller/Image/CustomStreamController.php +++ b/src/Asset/Controller/Image/CustomStreamController.php @@ -43,7 +43,6 @@ use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseCodes; use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseHeaders; use Pimcore\Bundle\StudioBackendBundle\Util\Constant\UserPermissions; -use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpKernel\Attribute\MapQueryString; use Symfony\Component\Routing\Attribute\Route; diff --git a/src/Asset/MappedParameter/ImageDownloadConfigParameter.php b/src/Asset/MappedParameter/ImageDownloadConfigParameter.php index 9fd13faa..c8aaf66e 100644 --- a/src/Asset/MappedParameter/ImageDownloadConfigParameter.php +++ b/src/Asset/MappedParameter/ImageDownloadConfigParameter.php @@ -47,23 +47,22 @@ public function __construct( throw new InvalidArgumentException('Invalid resize mode ' . $this->resizeMode); } - if($this->resizeMode === ResizeModes::SCALE_BY_HEIGHT && !$this->isValidHeight()) { + if ($this->resizeMode === ResizeModes::SCALE_BY_HEIGHT && !$this->isValidHeight()) { throw new InvalidArgumentException( 'Height must be set and non-negative when using scale by width resize mode' ); } - if($this->resizeMode === ResizeModes::SCALE_BY_WIDTH && !$this->isValidWidth()) { + if ($this->resizeMode === ResizeModes::SCALE_BY_WIDTH && !$this->isValidWidth()) { throw new InvalidArgumentException( 'Width must be set and non-negative when using scale by width resize mode' ); } - if( + if ( (!$this->isValidWidth() || !$this->isValidHeight()) && ($this->hasFrame() || $this->hasCover() || $this->hasContain() || $this->resizeMode === ResizeModes::RESIZE) - ) - { + ) { throw new InvalidArgumentException( 'Width, height must be set and non-negative when using frame, cover, contain or resize' ); @@ -115,7 +114,7 @@ public function getFrameTransformation(): array return [ 'width' => $this->getWidth(), 'height' => $this->getHeight(), - 'forceResize' => $this->getForceResize() + 'forceResize' => $this->getForceResize(), ]; } @@ -124,7 +123,7 @@ public function getContainTransformation(): array return [ 'width' => $this->getWidth(), 'height' => $this->getHeight(), - 'forceResize' => $this->getForceResize() + 'forceResize' => $this->getForceResize(), ]; } diff --git a/src/Asset/Service/BinaryService.php b/src/Asset/Service/BinaryService.php index 1173a8f2..333bc55d 100644 --- a/src/Asset/Service/BinaryService.php +++ b/src/Asset/Service/BinaryService.php @@ -83,8 +83,7 @@ public function streamPreviewImageThumbnail(Asset $image): StreamedResponse public function streamImageThumbnailFromConfig( Asset $image, ImageDownloadConfigParameter $configParameter - ): StreamedResponse - { + ): StreamedResponse { if (!$image instanceof Image) { throw new InvalidElementTypeException($image->getType()); } diff --git a/src/Asset/Service/ThumbnailService.php b/src/Asset/Service/ThumbnailService.php index 25eae6a7..7eb514fa 100644 --- a/src/Asset/Service/ThumbnailService.php +++ b/src/Asset/Service/ThumbnailService.php @@ -168,15 +168,15 @@ private function getImageThumbnailConfig( } } - if($parameters->hasCover()) { + if ($parameters->hasCover()) { $thumbnailConfig->addItem('cover', $parameters->getCoverTransformation()); } - if($parameters->hasFrame()) { + if ($parameters->hasFrame()) { $thumbnailConfig->addItem('frame', $parameters->getFrameTransformation()); } - if($parameters->hasContain()) { + if ($parameters->hasContain()) { $thumbnailConfig->addItem('contain', $parameters->getContainTransformation()); }