diff --git a/lib/private/Image/Gmagick.php b/lib/private/Image/Gmagick.php index 9313a407348bd..507246802a9a2 100644 --- a/lib/private/Image/Gmagick.php +++ b/lib/private/Image/Gmagick.php @@ -90,10 +90,7 @@ protected function _write($filePath = null, $mimeType = null): bool { break; case IMAGETYPE_JPEG: $compression = Gmagick::COMPRESSION_JPEG; - $quality = $this->getJpegQuality(); - if ($quality !== null) { - $this->resource->setImageCompressionQuality($quality); - } + $this->resource->setImageCompressionQuality($this->getJpegQuality()); break; case IMAGETYPE_PNG: $compression = Gmagick::COMPRESSION_ZIP; @@ -134,10 +131,7 @@ public function data(): ?string { break; case "image/jpeg": $compression = Gmagick::COMPRESSION_JPEG; - $quality = $this->getJpegQuality(); - if ($quality !== null) { - $this->resource->setImageCompressionQuality($quality); - } + $this->resource->setImageCompressionQuality($this->getJpegQuality()); break; case "image/gif": $compression = Gmagick::COMPRESSION_LZW; diff --git a/lib/private/Image/Imagick.php b/lib/private/Image/Imagick.php index dfa21ca5108f1..917dfb54dc6b4 100644 --- a/lib/private/Image/Imagick.php +++ b/lib/private/Image/Imagick.php @@ -90,10 +90,7 @@ protected function _write($filePath = null, $mimeType = null): bool { break; case IMAGETYPE_JPEG: $compression = Imagick::COMPRESSION_JPEG; - $quality = $this->getJpegQuality(); - if ($quality !== null) { - $this->resource->setImageCompressionQuality($quality); - } + $this->resource->setImageCompressionQuality($this->getJpegQuality()); break; case IMAGETYPE_PNG: $compression = Imagick::COMPRESSION_ZIP; @@ -134,10 +131,7 @@ public function data(): ?string { break; case "image/jpeg": $compression = Imagick::COMPRESSION_JPEG; - $quality = $this->getJpegQuality(); - if ($quality !== null) { - $this->resource->setImageCompressionQuality($quality); - } + $this->resource->setImageCompressionQuality($this->getJpegQuality()); break; case "image/gif": $compression = Imagick::COMPRESSION_LZW;