drewnoakes / metadata-extractor-dotnet

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Other
934 stars 165 forks source link

Map QuickTime com.android.manufacturer and com.android.model #309

Closed RealDolos closed 3 years ago

RealDolos commented 3 years ago

Map com.android.manufacturer to QuickTimeMetadataHeaderDirectory.TagMake and com.android.model to QuickTimeMetadataHeaderDirectory.TagModel respectively.

A lot of the (newer) Android phones will use these tags instead of com.apple.quicktime.make and com.apple.quicktime.model, respectively.

I am running right now with this little cheat to avoid forking the lib and it seems to work fine:

var field =
  (Dictionary<string, int>)typeof(QuickTimeMetadataHeaderDirectory).GetField(
    "_nameTagMap",
    BindingFlags.Static | BindingFlags.NonPublic)!.GetValue(null)!;

field.Add("com.android.manufacturer", QuickTimeMetadataHeaderDirectory.TagMake);
field.Add("com.android.model", QuickTimeMetadataHeaderDirectory.TagModel);

Mapping these tags onto Apple's QuickTime tags might not be to everybody's liking, but it seems reasonable to me because

drewnoakes commented 3 years ago

Thanks for this. I created new tags for these in #310, to avoid any potential for problem. It's less ergonomic to consume these, but potentially less surprising. We have a separate issue to track sourcing a conceptual value (such as model, date, etc) from multiple tags, which would help with the ergonomics.

Can you share an image that contains these values? None of the sample images we have registered a change following #310.