1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-12 00:43:59 +02:00

Rename method

- ImageInterface::getExif to ImageInterface:exif
This commit is contained in:
Oliver Vogel
2023-10-26 16:24:06 +02:00
parent af5f8f0a43
commit f296bc5d51
6 changed files with 7 additions and 7 deletions

View File

@@ -376,7 +376,7 @@ abstract class AbstractImage implements ImageInterface
return $this; return $this;
} }
public function getExif(?string $query = null): mixed public function exif(?string $query = null): mixed
{ {
if (!isset($this->exif)) { if (!isset($this->exif)) {
return new Collection(); return new Collection();

View File

@@ -47,7 +47,7 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
$image->setExif($this->decodeExifData($input)); $image->setExif($this->decodeExifData($input));
// fix image orientation // fix image orientation
return match ($image->getExif('IFD0.Orientation')) { return match ($image->exif('IFD0.Orientation')) {
2 => $image->flip(), 2 => $image->flip(),
3 => $image->rotate(180), 3 => $image->rotate(180),
4 => $image->rotate(180)->flip(), 4 => $image->rotate(180)->flip(),

View File

@@ -60,7 +60,7 @@ interface ImageInterface extends Traversable, Countable
* *
* @return mixed * @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) * Set exif data on current image (will not be written in final image)

View File

@@ -431,8 +431,8 @@ class AbstractImageTest extends TestCase
$img = $this->abstractImageMock(); $img = $this->abstractImageMock();
$img->setExif((['test' => 'value'])); $img->setExif((['test' => 'value']));
$this->assertInstanceOf(Collection::class, $img->getExif()); $this->assertInstanceOf(Collection::class, $img->exif());
$this->assertEquals('value', $img->getExif('test')); $this->assertEquals('value', $img->exif('test'));
} }
public function testDestroy(): void public function testDestroy(): void

View File

@@ -50,6 +50,6 @@ class BinaryImageDecoderTest extends TestCase
$this->assertEquals(16, $image->width()); $this->assertEquals(16, $image->width());
$this->assertEquals(16, $image->height()); $this->assertEquals(16, $image->height());
$this->assertCount(1, $image); $this->assertCount(1, $image);
$this->assertEquals('Oliver Vogel', $image->getExif('IFD0.Artist')); $this->assertEquals('Oliver Vogel', $image->exif('IFD0.Artist'));
} }
} }

View File

@@ -49,7 +49,7 @@ class BinaryImageDecoderTest extends TestCase
$this->assertEquals(16, $image->width()); $this->assertEquals(16, $image->width());
$this->assertEquals(16, $image->height()); $this->assertEquals(16, $image->height());
$this->assertCount(1, $image); $this->assertCount(1, $image);
$this->assertEquals('Oliver Vogel', $image->getExif('IFD0.Artist')); $this->assertEquals('Oliver Vogel', $image->exif('IFD0.Artist'));
} }
public function testDecodeCmykImage(): void public function testDecodeCmykImage(): void