Upgrade to 3.6.1

This commit is contained in:
Bastian Allgeier
2021-12-07 12:39:37 +01:00
parent 9fc43ea22c
commit 70b8439c49
134 changed files with 19987 additions and 1100 deletions

View File

@@ -177,7 +177,7 @@ class ImageMagick extends Darkroom
{
// simple resize
if ($options['crop'] === false) {
return sprintf('-resize %sx%s!', $options['width'], $options['height']);
return sprintf('-thumbnail %sx%s!', $options['width'], $options['height']);
}
$gravities = [
@@ -195,7 +195,7 @@ class ImageMagick extends Darkroom
// translate the gravity option into something imagemagick understands
$gravity = $gravities[$options['crop']] ?? 'Center';
$command = sprintf('-resize %sx%s^', $options['width'], $options['height']);
$command = sprintf('-thumbnail %sx%s^', $options['width'], $options['height']);
$command .= sprintf(' -gravity %s -crop %sx%s+0+0', $gravity, $options['width'], $options['height']);
return $command;
@@ -227,6 +227,14 @@ class ImageMagick extends Darkroom
*/
protected function strip(string $file, array $options): string
{
return '-strip';
if (F::extension($file) === 'png') {
// ImageMagick does not support keeping ICC profiles while
// stripping other privacy- and security-related information,
// such as GPS data; so discard all color profiles for PNG files
// (tested with ImageMagick 7.0.11-14 Q16 x86_64 2021-05-31)
return '-strip';
}
return '';
}
}

View File

@@ -116,7 +116,7 @@ class Image extends File
*/
public function exif()
{
return $this->exif = $this->exif ?? new Exif($this);
return $this->exif ??= new Exif($this);
}
/**