From f296bc5d51a2d095beacdaf614a3b7ece7598d7a Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Thu, 26 Oct 2023 16:24:06 +0200 Subject: [PATCH] Rename method - ImageInterface::getExif to ImageInterface:exif --- src/Drivers/Abstract/AbstractImage.php | 2 +- src/Drivers/Gd/Decoders/BinaryImageDecoder.php | 2 +- src/Interfaces/ImageInterface.php | 2 +- tests/Drivers/Abstract/AbstractImageTest.php | 4 ++-- tests/Drivers/Gd/Decoders/BinaryImageDecoderTest.php | 2 +- tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Drivers/Abstract/AbstractImage.php b/src/Drivers/Abstract/AbstractImage.php index a0d713f8..c1bfb75a 100644 --- a/src/Drivers/Abstract/AbstractImage.php +++ b/src/Drivers/Abstract/AbstractImage.php @@ -376,7 +376,7 @@ abstract class AbstractImage implements ImageInterface return $this; } - public function getExif(?string $query = null): mixed + public function exif(?string $query = null): mixed { if (!isset($this->exif)) { return new Collection(); diff --git a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php index ae90dd86..d32f1a7c 100644 --- a/src/Drivers/Gd/Decoders/BinaryImageDecoder.php +++ b/src/Drivers/Gd/Decoders/BinaryImageDecoder.php @@ -47,7 +47,7 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface $image->setExif($this->decodeExifData($input)); // fix image orientation - return match ($image->getExif('IFD0.Orientation')) { + return match ($image->exif('IFD0.Orientation')) { 2 => $image->flip(), 3 => $image->rotate(180), 4 => $image->rotate(180)->flip(), diff --git a/src/Interfaces/ImageInterface.php b/src/Interfaces/ImageInterface.php index a981cfbb..f793ea92 100644 --- a/src/Interfaces/ImageInterface.php +++ b/src/Interfaces/ImageInterface.php @@ -60,7 +60,7 @@ interface ImageInterface extends Traversable, Countable * * @return mixed */ - public function getExif(?string $query = null): mixed; + public function exif(?string $query = null): mixed; /** * Set exif data on current image (will not be written in final image) diff --git a/tests/Drivers/Abstract/AbstractImageTest.php b/tests/Drivers/Abstract/AbstractImageTest.php index 2d079a13..bbf08adb 100644 --- a/tests/Drivers/Abstract/AbstractImageTest.php +++ b/tests/Drivers/Abstract/AbstractImageTest.php @@ -431,8 +431,8 @@ class AbstractImageTest extends TestCase $img = $this->abstractImageMock(); $img->setExif((['test' => 'value'])); - $this->assertInstanceOf(Collection::class, $img->getExif()); - $this->assertEquals('value', $img->getExif('test')); + $this->assertInstanceOf(Collection::class, $img->exif()); + $this->assertEquals('value', $img->exif('test')); } public function testDestroy(): void diff --git a/tests/Drivers/Gd/Decoders/BinaryImageDecoderTest.php b/tests/Drivers/Gd/Decoders/BinaryImageDecoderTest.php index f511bee6..29421862 100644 --- a/tests/Drivers/Gd/Decoders/BinaryImageDecoderTest.php +++ b/tests/Drivers/Gd/Decoders/BinaryImageDecoderTest.php @@ -50,6 +50,6 @@ class BinaryImageDecoderTest extends TestCase $this->assertEquals(16, $image->width()); $this->assertEquals(16, $image->height()); $this->assertCount(1, $image); - $this->assertEquals('Oliver Vogel', $image->getExif('IFD0.Artist')); + $this->assertEquals('Oliver Vogel', $image->exif('IFD0.Artist')); } } diff --git a/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php b/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php index f91a6792..286b1a03 100644 --- a/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php +++ b/tests/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php @@ -49,7 +49,7 @@ class BinaryImageDecoderTest extends TestCase $this->assertEquals(16, $image->width()); $this->assertEquals(16, $image->height()); $this->assertCount(1, $image); - $this->assertEquals('Oliver Vogel', $image->getExif('IFD0.Artist')); + $this->assertEquals('Oliver Vogel', $image->exif('IFD0.Artist')); } public function testDecodeCmykImage(): void