1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-11 16:34:00 +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;
}
public function getExif(?string $query = null): mixed
public function exif(?string $query = null): mixed
{
if (!isset($this->exif)) {
return new Collection();

View File

@@ -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(),

View File

@@ -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)

View File

@@ -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

View File

@@ -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'));
}
}

View File

@@ -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