From a4481bfd3315ed6cdf10f9f16aced74ced2d026b Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 25 Jan 2021 15:25:02 +0200 Subject: [PATCH] Fixed cannot change image format [#3173] --- CHANGELOG.md | 1 + system/src/Grav/Common/Media/Traits/ImageMediaTrait.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4572f8ba..c8088cb5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#bugfix) * Fixed `bin/gpm uninstall` script not working because of bad typehint [#3172](https://github.com/getgrav/grav/issues/3172) * Fixed `login: visibility_requires_access` not working [#3176](https://github.com/getgrav/grav/issues/3176) + * Fixed cannot change image format [#3173](https://github.com/getgrav/grav/issues/3173) # v1.7.3 ## 01/21/2021 diff --git a/system/src/Grav/Common/Media/Traits/ImageMediaTrait.php b/system/src/Grav/Common/Media/Traits/ImageMediaTrait.php index b187cf7a3..1acf4410c 100644 --- a/system/src/Grav/Common/Media/Traits/ImageMediaTrait.php +++ b/system/src/Grav/Common/Media/Traits/ImageMediaTrait.php @@ -383,8 +383,10 @@ trait ImageMediaTrait return $this->result; } - $extension = strtolower($this->get('extension')); - $this->format($extension); + if ($this->format === 'guess') { + $extension = strtolower($this->get('extension')); + $this->format($extension); + } if (!$this->debug_watermarked && $this->get('debug')) { $ratio = $this->get('ratio');