这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/Image/Adapter/Imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public function load($imagePath, $options = [])
// only for vector graphics
// the below causes problems with PSDs when target format is PNG32 (nobody knows why ;-))
$i->setBackgroundColor(new \ImagickPixel('transparent'));
if(version_compare($this->getImageMagickVersion(),'7.1.0-32') >= 0) {
// workaround for ImageMagick >= 7.1.0-32, see https://github.com/pimcore/pimcore/issues/13167
$i->setBackgroundColor(new \ImagickPixel("rgba(255, 255, 255, 0.00000001)"));
}
}

if (isset($options['resolution'])) {
Expand Down Expand Up @@ -1072,4 +1076,11 @@ protected function checkFormatSupport(string $format): bool
return false;
}
}

private function getImageMagickVersion(): string
{
$v = \Imagick::getVersion();
preg_match('/ImageMagick ([\d]+\.[\d]+\.[\d]+\-[\d]+)/', $v['versionString'], $matches);
return $matches[1];
}
}