diff --git a/lib/Db/TimelineWrite.php b/lib/Db/TimelineWrite.php index 68004b1e..ff871305 100644 --- a/lib/Db/TimelineWrite.php +++ b/lib/Db/TimelineWrite.php @@ -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); diff --git a/lib/Exif.php b/lib/Exif.php index 1011a061..68f0255d 100644 --- a/lib/Exif.php +++ b/lib/Exif.php @@ -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; }