Skip to content

Commit e5a55e3

Browse files
authored
Merge pull request #3568 from paulbalandan/getexif
Update BaseHandler::getEXIF
2 parents cc8154f + defe381 commit e5a55e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

system/Images/Handlers/BaseHandler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ public function reorient(bool $silent = false)
597597
* @param string|null $key If specified, will only return this piece of EXIF data.
598598
* @param boolean $silent If true, will not throw our own exceptions.
599599
*
600+
* @throws \CodeIgniter\Images\Exceptions\ImageException
601+
*
600602
* @return mixed
601603
*/
602604
public function getEXIF(string $key = null, bool $silent = false)
@@ -607,14 +609,16 @@ public function getEXIF(string $key = null, bool $silent = false)
607609
{
608610
return null;
609611
}
612+
613+
throw ImageException::forEXIFUnsupported(); // @codeCoverageIgnore
610614
}
611615

612616
$exif = null; // default
613617
switch ($this->image()->imageType)
614618
{
615619
case IMAGETYPE_JPEG:
616620
case IMAGETYPE_TIFF_II:
617-
$exif = exif_read_data($this->image()->getPathname());
621+
$exif = @exif_read_data($this->image()->getPathname());
618622
if (! is_null($key) && is_array($exif))
619623
{
620624
$exif = $exif[$key] ?? false;

0 commit comments

Comments
 (0)