diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/MultiPage.kt b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/MultiPage.kt index 25f1bab85..53c5b472d 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/MultiPage.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/MultiPage.kt @@ -174,9 +174,7 @@ object MultiPage { } else if (xmpMeta.doesPropExist(XMP.GCONTAINER_DIRECTORY_PROP_NAME)) { // `Container` motion photo val count = xmpMeta.countPropArrayItems(XMP.GCONTAINER_DIRECTORY_PROP_NAME) - if (count == 2) { - // expect the video to be the second item - val i = 2 + for (i in 1 until count + 1) { val mime = xmpMeta.getSafeStructField(listOf(XMP.GCONTAINER_DIRECTORY_PROP_NAME, i, XMP.GCONTAINER_ITEM_PROP_NAME, XMP.GCONTAINER_ITEM_MIME_PROP_NAME))?.value val length = xmpMeta.getSafeStructField(listOf(XMP.GCONTAINER_DIRECTORY_PROP_NAME, i, XMP.GCONTAINER_ITEM_PROP_NAME, XMP.GCONTAINER_ITEM_LENGTH_PROP_NAME))?.value if (MimeTypes.isVideo(mime) && length != null) { diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt index 47d2b75f2..e593dd16c 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/XMP.kt @@ -188,17 +188,15 @@ object XMP { // Container motion photo if (doesPropExist(GCONTAINER_DIRECTORY_PROP_NAME)) { val count = countPropArrayItems(GCONTAINER_DIRECTORY_PROP_NAME) - if (count == 2) { - var hasImage = false - var hasVideo = false - for (i in 1 until count + 1) { - val mime = getSafeStructField(listOf(GCONTAINER_DIRECTORY_PROP_NAME, i, GCONTAINER_ITEM_PROP_NAME, GCONTAINER_ITEM_MIME_PROP_NAME))?.value - val length = getSafeStructField(listOf(GCONTAINER_DIRECTORY_PROP_NAME, i, GCONTAINER_ITEM_PROP_NAME, GCONTAINER_ITEM_LENGTH_PROP_NAME))?.value - hasImage = hasImage || MimeTypes.isImage(mime) && length != null - hasVideo = hasVideo || MimeTypes.isVideo(mime) && length != null - } - if (hasImage && hasVideo) return true + var hasImage = false + var hasVideo = false + for (i in 1 until count + 1) { + val mime = getSafeStructField(listOf(GCONTAINER_DIRECTORY_PROP_NAME, i, GCONTAINER_ITEM_PROP_NAME, GCONTAINER_ITEM_MIME_PROP_NAME))?.value + val length = getSafeStructField(listOf(GCONTAINER_DIRECTORY_PROP_NAME, i, GCONTAINER_ITEM_PROP_NAME, GCONTAINER_ITEM_LENGTH_PROP_NAME))?.value + hasImage = hasImage || MimeTypes.isImage(mime) && length != null + hasVideo = hasVideo || MimeTypes.isVideo(mime) && length != null } + if (hasImage && hasVideo) return true } return false diff --git a/lib/ref/metadata/xmp.dart b/lib/ref/metadata/xmp.dart index 7548cdc13..fa2dbdb13 100644 --- a/lib/ref/metadata/xmp.dart +++ b/lib/ref/metadata/xmp.dart @@ -37,6 +37,7 @@ class XmpNamespaces { static const gettyImagesGift = 'http://xmp.gettyimages.com/gift/1.0/'; static const gimp210 = 'http://www.gimp.org/ns/2.10/'; static const gimpXmp = 'http://www.gimp.org/xmp/'; + static const hdrgm = 'http://ns.adobe.com/hdr-gain-map/1.0/'; static const illustrator = 'http://ns.adobe.com/illustrator/1.0/'; static const iptc4xmpCore = 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'; static const iptc4xmpExt = 'http://iptc.org/std/Iptc4xmpExt/2008-02-29/'; diff --git a/lib/view/src/xmp.dart b/lib/view/src/xmp.dart index e2f185726..438a5d4fe 100644 --- a/lib/view/src/xmp.dart +++ b/lib/view/src/xmp.dart @@ -34,6 +34,7 @@ class XmpNamespaceView { XmpNamespaces.gettyImagesGift: 'Getty Images', XmpNamespaces.gimp210: 'GIMP 2.10', XmpNamespaces.gimpXmp: 'GIMP', + XmpNamespaces.hdrgm: 'HDR Gain Map', XmpNamespaces.illustrator: 'Illustrator', XmpNamespaces.iptc4xmpCore: 'IPTC Core', XmpNamespaces.iptc4xmpExt: 'IPTC Extension',