From f46956de6d8e0f2f1846ab2f371cdd56f713645b Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 14 May 2019 10:20:01 -0700 Subject: [PATCH] Cleanup --- src/image/Raster.php | 3 ++- src/image/Svg.php | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/image/Raster.php b/src/image/Raster.php index ed0fc69b222..ce1a0a36aab 100644 --- a/src/image/Raster.php +++ b/src/image/Raster.php @@ -175,7 +175,8 @@ public function loadImage(string $path) } // For Imagick, convert CMYK to RGB, save and re-open. - if (!Craft::$app->getImages()->getIsGd() + if ( + !Craft::$app->getImages()->getIsGd() && !Craft::$app->getConfig()->getGeneral()->preserveCmykColorspace && method_exists($this->_image->getImagick(), 'getImageColorspace') && $this->_image->getImagick()->getImageColorspace() === \Imagick::COLORSPACE_CMYK diff --git a/src/image/Svg.php b/src/image/Svg.php index c2fc326397e..480bffe6b19 100644 --- a/src/image/Svg.php +++ b/src/image/Svg.php @@ -216,8 +216,7 @@ public function resize(int $targetWidth, int $targetHeight = null) { $this->normalizeDimensions($targetWidth, $targetHeight); - if (preg_match(self::SVG_WIDTH_RE, $this->_svgContent) && preg_match(self::SVG_HEIGHT_RE, $this->_svgContent) - ) { + if (preg_match(self::SVG_WIDTH_RE, $this->_svgContent) && preg_match(self::SVG_HEIGHT_RE, $this->_svgContent)) { $this->_svgContent = preg_replace(self::SVG_WIDTH_RE, "\${1}{$targetWidth}px\"", $this->_svgContent); $this->_svgContent = preg_replace(self::SVG_HEIGHT_RE, "\${1}{$targetHeight}px\"", $this->_svgContent); } else {