From 101014de2775e17c2e895bfb76e799e06e784a9a Mon Sep 17 00:00:00 2001 From: Stefan Lenselink Date: Fri, 5 Apr 2024 15:01:37 +0200 Subject: [PATCH] Ensure the result of GpsLocation is consistant when running the regression tests in metadata-extractor-images for both mov and mp4 files. --- .../QuickTime/QuickTimeMetadataReader.cs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs b/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs index 35bfd758..257ace64 100644 --- a/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs +++ b/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs @@ -122,9 +122,26 @@ void UuidHandler(AtomCallbackArgs a) void UserDataHandler(AtomCallbackArgs a) { - switch (a.TypeString) + var key = a.TypeString; + if (key.Length < 1) + { + return; + } + if (key[0] == 0xa9 || key[0] == 0x40) + { + //Tag ID's beginning with the copyright symbol (hex 0xa9) are multi-language text + //Alternate language tags are accessed by adding a dash followed by a 3-character ISO 639-2 language code to the tag name. + + //some stupid Ricoh programmer used the '@' symbol instead of the copyright symbol in these tag ID's for the Ricoh Theta Z1 and maybe other models + + //For now we don't support those, we will strip the copyright and locale info + key = key.Substring(1); + key = key.Split('-')[0]; + } + + switch (key) { - case "?xyz": + case "xyz": var stringSize = a.Reader.GetUInt16(); a.Reader.Skip(2); // uint16 language code var stringBytes = a.Reader.GetBytes(stringSize);