1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 04:01:30 +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
if ($this->driver()->config()->autoOrientation === true) {
if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier());
}

View File

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

View File

@@ -60,7 +60,7 @@ class NativeObjectDecoder extends AbstractDecoder
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),

View File

@@ -40,12 +40,12 @@ class NativeObjectDecoder extends SpecializableDecoder
);
// 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());
}

View File

@@ -58,5 +58,9 @@ final class ConfigTest extends BaseTestCase
$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);
}
}