Skip to content

Commit

Permalink
Return empty collection if no exif data is set
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Oct 6, 2023
1 parent f15a309 commit 55807ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Drivers/Abstract/AbstractImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Intervention\Image\Drivers\Abstract;

use Intervention\Gif\Exception\NotReadableException;
use Intervention\Image\Collection;
use Intervention\Image\EncodedImage;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Geometry\Circle;
use Intervention\Image\Geometry\Ellipse;
use Intervention\Image\Geometry\Line;
Expand All @@ -20,7 +18,6 @@
use Intervention\Image\Traits\CanHandleInput;
use Intervention\Image\Traits\CanResolveDriverClass;
use Intervention\Image\Traits\CanRunCallback;
use ReflectionProperty;

abstract class AbstractImage implements ImageInterface
{
Expand All @@ -30,8 +27,6 @@ abstract class AbstractImage implements ImageInterface

protected Collection $exif;



public function eachFrame(callable $callback): ImageInterface
{
foreach ($this as $frame) {
Expand Down Expand Up @@ -364,6 +359,10 @@ public function setExif(array $data): ImageInterface

public function getExif(?string $query = null): mixed
{
if (!isset($this->exif)) {
return new Collection();
}

return is_null($query) ? $this->exif : $this->exif->get($query);
}

Expand Down

0 comments on commit 55807ff

Please sign in to comment.