diff --git a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php index eda4f73e..5eddf07f 100644 --- a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php +++ b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php @@ -60,7 +60,7 @@ private function decodeBinary(string $input): ImageInterface } // adjust image orientation - if ($this->driver()->config()->autoOrientation === true) { + if ($this->driver()->config()->autoOrientation) { $image->modify(new AlignRotationModifier()); } diff --git a/src/Drivers/Gd/Decoders/FilePathImageDecoder.php b/src/Drivers/Gd/Decoders/FilePathImageDecoder.php index ace598a5..fcfd2c64 100644 --- a/src/Drivers/Gd/Decoders/FilePathImageDecoder.php +++ b/src/Drivers/Gd/Decoders/FilePathImageDecoder.php @@ -50,7 +50,7 @@ public function decode(mixed $input): ImageInterface|ColorInterface $image->setExif($this->extractExifData($input)); // adjust image orientation - if ($this->driver()->config()->autoOrientation === true) { + if ($this->driver()->config()->autoOrientation) { $image->modify(new AlignRotationModifier()); } diff --git a/src/Drivers/Gd/Decoders/NativeObjectDecoder.php b/src/Drivers/Gd/Decoders/NativeObjectDecoder.php index 14c0058a..740e58e7 100644 --- a/src/Drivers/Gd/Decoders/NativeObjectDecoder.php +++ b/src/Drivers/Gd/Decoders/NativeObjectDecoder.php @@ -60,7 +60,7 @@ public function decode(mixed $input): ImageInterface|ColorInterface protected function decodeGif(mixed $input): ImageInterface { // create non-animated image depending on config - if (!$this->driver()->config()->decodeAnimation === true) { + if (!$this->driver()->config()->decodeAnimation) { $native = match (true) { $this->isGifFormat($input) => @imagecreatefromstring($input), default => @imagecreatefromgif($input), diff --git a/src/Drivers/Imagick/Decoders/NativeObjectDecoder.php b/src/Drivers/Imagick/Decoders/NativeObjectDecoder.php index 79b77d41..9d65e09e 100644 --- a/src/Drivers/Imagick/Decoders/NativeObjectDecoder.php +++ b/src/Drivers/Imagick/Decoders/NativeObjectDecoder.php @@ -40,12 +40,12 @@ public function decode(mixed $input): ImageInterface|ColorInterface ); // discard animation depending on config - if (!$this->driver()->config()->decodeAnimation === true) { + if (!$this->driver()->config()->decodeAnimation) { $image->modify(new RemoveAnimationModifier()); } // adjust image rotatation - if ($this->driver()->config()->autoOrientation === true) { + if ($this->driver()->config()->autoOrientation) { $image->modify(new AlignRotationModifier()); } diff --git a/tests/Unit/ConfigTest.php b/tests/Unit/ConfigTest.php index e1502c1f..6f09cdff 100644 --- a/tests/Unit/ConfigTest.php +++ b/tests/Unit/ConfigTest.php @@ -58,5 +58,9 @@ public function testGetSetOptions(): void $this->assertFalse($config->autoOrientation); $this->assertFalse($config->decodeAnimation); $this->assertEquals('000', $config->blendingColor); + + $this->assertFalse($result->autoOrientation); + $this->assertFalse($result->decodeAnimation); + $this->assertEquals('000', $result->blendingColor); } }