diff --git a/lib/Db/LivePhoto.php b/lib/Db/LivePhoto.php index 37a86f74a..5f2e29170 100644 --- a/lib/Db/LivePhoto.php +++ b/lib/Db/LivePhoto.php @@ -52,6 +52,22 @@ public function getLivePhotoId(File $file, array $exif): string return "self__traileroffset={$videoOffset}"; } + // Samsung JPEG (tested w/ S24) + // https://github.com/pulsejet/memories/issues/1265 + if (($embedType = $exif['EmbeddedVideoType'] ?? null) + && \in_array($embedType, ['MotionPhoto_Data'], true) + && ($exif['EmbeddedVideoFile'] ?? null) + ) { + // Binary exif field, decode when the user requests it + // While this is the most reliable way, it is slow + return 'self__exifbin=EmbeddedVideoFile'; + } + + // Samsung HEIC (tested w/ S21) + if (!empty($exif['MotionPhotoVideo'] ?? null)) { + return 'self__exifbin=MotionPhotoVideo'; + } + // Google JPEG and Samsung HEIC / JPEG (Apple?) if ($exif['MotionPhoto'] ?? null) { if ('image/jpeg' === ($exif['MIMEType'] ?? null)) { @@ -109,12 +125,6 @@ public function getLivePhotoId(File $file, array $exif): string } } - // Samsung HEIC (at least S21) - if (!empty($exif['MotionPhotoVideo'] ?? null)) { - // It's a binary exif field, decode when the user requests it - return 'self__exifbin=MotionPhotoVideo'; - } - return ''; }