Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed May 10, 2024
1 parent 59781c7 commit eed36c4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Drivers/Gd/Decoders/BinaryImageDecoder.php
Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Gd/Decoders/FilePathImageDecoder.php
Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Gd/Decoders/NativeObjectDecoder.php
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/Imagick/Decoders/NativeObjectDecoder.php
Expand Up @@ -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());
}

Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/ConfigTest.php
Expand Up @@ -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);
}
}

0 comments on commit eed36c4

Please sign in to comment.