diff --git a/system/Images/Handlers/ImageMagickHandler.php b/system/Images/Handlers/ImageMagickHandler.php index 3215c84f1ab3..4a92ddf7900b 100644 --- a/system/Images/Handlers/ImageMagickHandler.php +++ b/system/Images/Handlers/ImageMagickHandler.php @@ -318,13 +318,10 @@ public function save(?string $target = null, int $quality = 90): bool } $this->ensureResource(); - $this->resource->setImageCompressionQuality($quality); - if ($target !== null) { - $extension = pathinfo($target, PATHINFO_EXTENSION); - $this->resource->setImageFormat($extension); - } + $extension = pathinfo($target, PATHINFO_EXTENSION); + $this->resource->setImageFormat($extension); try { $result = $this->resource->writeImage($target); diff --git a/system/Images/Image.php b/system/Images/Image.php index 77eecf8e7b8e..9a396241c158 100644 --- a/system/Images/Image.php +++ b/system/Images/Image.php @@ -73,7 +73,7 @@ public function copy(string $targetPath, ?string $targetName = null, int $perms $targetName ??= $this->getFilename(); - if ($targetName === null || $targetName === '') { + if ($targetName === '') { throw ImageException::forInvalidFile($targetName); }