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