exif: add null check for MIMEType
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/888/head
parent
1ad0559436
commit
d8f327141f
|
@ -91,6 +91,11 @@ class TimelineWrite
|
|||
throw new \Exception('No EXIF data could be read: '.$file->getPath());
|
||||
}
|
||||
|
||||
// Check if MIMEType was not detected
|
||||
if (empty($exif['MIMEType'] ?? null)) {
|
||||
throw new \Exception('No MIMEType in EXIF data: '.$file->getPath());
|
||||
}
|
||||
|
||||
// Hand off if Live Photo video part
|
||||
if ($isvideo && $this->livePhoto->isVideoPart($exif)) {
|
||||
$this->livePhoto->processVideoPart($file, $exif);
|
||||
|
|
|
@ -149,7 +149,7 @@ class Exif
|
|||
$exifDate = $exif['DateTimeOriginal'] ?? $exif['CreateDate'] ?? null;
|
||||
|
||||
// For videos, prefer CreateDate for timezone (QuickTimeUTC=1)
|
||||
if (preg_match('/^video\/\w+/', (string) $exif['MIMEType'])) {
|
||||
if (preg_match('/^video\/\w+/', (string) ($exif['MIMEType'] ?? null))) {
|
||||
$exifDate = $exif['CreateDate'] ?? $exifDate;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue