Skip to content

Commit 60c6f34

Browse files
authored
Composer update - php-exif 0.8 + bump to version 4.7 (#1680)
1 parent 2cc842f commit 60c6f34

File tree

5 files changed

+407
-355
lines changed

5 files changed

+407
-355
lines changed

app/Metadata/Extractor.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Carbon\Exceptions\InvalidTimeZoneException;
1414
use Illuminate\Support\Carbon;
1515
use PHPExif\Adapter\NoAdapterException;
16+
use PHPExif\Enum\ReaderType;
1617
use PHPExif\Exif;
1718
use PHPExif\Reader\Reader;
1819
use Safe\Exceptions\StringsException;
@@ -77,10 +78,10 @@ public static function createFromFile(NativeLocalFile $file): self
7778
// 3. Imagick (not for videos, i.e. for supported photos and accepted raw files only)
7879
// 4. Native PHP exif reader (last resort)
7980
$reader = match (true) {
80-
(Configs::hasFFmpeg() && $isSupportedVideo) => Reader::factory(Reader::TYPE_FFPROBE),
81-
Configs::hasExiftool() => Reader::factory(Reader::TYPE_EXIFTOOL),
82-
(Configs::hasImagick() && !$isSupportedVideo) => Reader::factory(Reader::TYPE_IMAGICK),
83-
default => Reader::factory(Reader::TYPE_NATIVE),
81+
(Configs::hasFFmpeg() && $isSupportedVideo) => Reader::factory(ReaderType::FFPROBE),
82+
Configs::hasExiftool() => Reader::factory(ReaderType::EXIFTOOL),
83+
(Configs::hasImagick() && !$isSupportedVideo) => Reader::factory(ReaderType::IMAGICK),
84+
default => Reader::factory(ReaderType::NATIVE),
8485
};
8586

8687
// this can throw an exception in the case of Exiftool adapter!
@@ -108,7 +109,7 @@ public static function createFromFile(NativeLocalFile $file): self
108109
try {
109110
Logs::notice(__METHOD__, __LINE__, 'Falling back to native adapter.');
110111
// Use Php native tools
111-
$reader = Reader::factory(Reader::TYPE_NATIVE);
112+
$reader = Reader::factory(ReaderType::NATIVE);
112113
$exif = $reader->read($file->getRealPath());
113114
} catch (\InvalidArgumentException|NoAdapterException $e) {
114115
throw new ExternalComponentMissingException('The configured EXIF adapter is not available', $e);
@@ -132,7 +133,7 @@ public static function createFromFile(NativeLocalFile $file): self
132133
if (Configs::hasExiftool() && $sidecarFile->exists()) {
133134
try {
134135
// Don't use the same reader as the file in case it's a video
135-
$sidecarReader = Reader::factory(Reader::TYPE_EXIFTOOL);
136+
$sidecarReader = Reader::factory(ReaderType::EXIFTOOL);
136137
$sideCarExifData = $sidecarReader->read($sidecarFile->getRealPath());
137138
if (!$sideCarExifData instanceof Exif) {
138139
throw new MediaFileOperationException('Could not even extract EXIF data with the exiftool adapter');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"laravel/framework": "^9.2",
5454
"livewire/livewire": "^2.7",
5555
"lychee-org/nestedset": "^6",
56-
"lychee-org/php-exif": "^0.7.14",
56+
"lychee-org/php-exif": "^0.8",
5757
"maennchen/zipstream-php": "^2.1",
5858
"php-ffmpeg/php-ffmpeg": "^1.0",
5959
"php-http/guzzle7-adapter": "^1.0",

0 commit comments

Comments
 (0)