Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Fix exif_imagetype handling
Browse files Browse the repository at this point in the history
  • Loading branch information
marttinnotta committed Jan 6, 2023
1 parent c1f0ec3 commit cd1b47f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

---

## [3.1.1] - 06-01-2023

### Fixed

- `isReadableImage` now returns false when `exif_imagetype` returns false instead of throwing exception

## [3.1.0] - 31-10-2022

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/Classes/MediaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public function isReadableImage($file): bool
try {
$type = exif_imagetype($file);

if (!$type) return false;

// https://github.com/Intervention/image/pull/1008
return !in_array($type, [IMAGETYPE_ICO]);
} catch (Exception $e) {
Expand Down

0 comments on commit cd1b47f

Please sign in to comment.