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:
@@ -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();
|
||||
|
@@ -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(),
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user