1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-20 04:31:24 +02:00
This commit is contained in:
Oliver Vogel
2024-05-10 19:01:37 +02:00
parent 59781c723e
commit eed36c4081
5 changed files with 9 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ class BinaryImageDecoder extends NativeObjectDecoder implements DecoderInterface
} }
// adjust image orientation // adjust image orientation
if ($this->driver()->config()->autoOrientation === true) { if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier()); $image->modify(new AlignRotationModifier());
} }

View File

@@ -50,7 +50,7 @@ class FilePathImageDecoder extends NativeObjectDecoder implements DecoderInterfa
$image->setExif($this->extractExifData($input)); $image->setExif($this->extractExifData($input));
// adjust image orientation // adjust image orientation
if ($this->driver()->config()->autoOrientation === true) { if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier()); $image->modify(new AlignRotationModifier());
} }

View File

@@ -60,7 +60,7 @@ class NativeObjectDecoder extends AbstractDecoder
protected function decodeGif(mixed $input): ImageInterface protected function decodeGif(mixed $input): ImageInterface
{ {
// create non-animated image depending on config // create non-animated image depending on config
if (!$this->driver()->config()->decodeAnimation === true) { if (!$this->driver()->config()->decodeAnimation) {
$native = match (true) { $native = match (true) {
$this->isGifFormat($input) => @imagecreatefromstring($input), $this->isGifFormat($input) => @imagecreatefromstring($input),
default => @imagecreatefromgif($input), default => @imagecreatefromgif($input),

View File

@@ -40,12 +40,12 @@ class NativeObjectDecoder extends SpecializableDecoder
); );
// discard animation depending on config // discard animation depending on config
if (!$this->driver()->config()->decodeAnimation === true) { if (!$this->driver()->config()->decodeAnimation) {
$image->modify(new RemoveAnimationModifier()); $image->modify(new RemoveAnimationModifier());
} }
// adjust image rotatation // adjust image rotatation
if ($this->driver()->config()->autoOrientation === true) { if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier()); $image->modify(new AlignRotationModifier());
} }

View File

@@ -58,5 +58,9 @@ final class ConfigTest extends BaseTestCase
$this->assertFalse($config->autoOrientation); $this->assertFalse($config->autoOrientation);
$this->assertFalse($config->decodeAnimation); $this->assertFalse($config->decodeAnimation);
$this->assertEquals('000', $config->blendingColor); $this->assertEquals('000', $config->blendingColor);
$this->assertFalse($result->autoOrientation);
$this->assertFalse($result->decodeAnimation);
$this->assertEquals('000', $result->blendingColor);
} }
} }