Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed May 14, 2019
1 parent daabc9d commit f46956d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/image/Raster.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/image/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f46956d

Please sign in to comment.