mirror of
https://github.com/Intervention/image.git
synced 2025-08-20 04:31:24 +02:00
Update
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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),
|
||||||
|
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user