drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.56k stars 480 forks source link

Initial support for BPLIST in Apple Makernotes #395

Closed nosnhojbob closed 4 years ago

nosnhojbob commented 5 years ago

This change introduces BPLIST (binary property list) support in Apple makernotes. The Apple makernote tag that comes with the most format documentation is 0x0003, RUN_TIME. I provided a new directory and descriptor for this field, supporting the raw properties and human-readable descriptions for the CMTime fields represented by this tag. I left some @see Javadoc pointers to the data structures and descriptions of the CMTime fields. Essentially, the CMTime structure provides a value and scale, where (value / scale) = seconds.

Two of the test "data" objects were taken from the existing image library samples of Apple/IOS images (read as Metadata, extracted as byte array) for the 0x0003 (RUN_TIME) and 0x0002 (unknown) fields. On a Mac, you can right-click on the files and it conveniently provides a "Get Info" preview function, which shows the BPLIST as an XML document. I used this output in my test assertions.

Limitations:

nosnhojbob commented 5 years ago

A quick note to the reviewer(s). I included a definition of 0x0015 (TAG_IMAGE_UNIQUE_ID), per the ExifTool's referenced page. However, after running against all of my personal iPhone photos, I could not find any that contained 0x0015. Based on the data in the fields, I suspect that 0x0016 is actually the "image unique identifier". I did some more looking on the ExifTool forums and found:

http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,8750.msg44954.html#msg44954

I can't find why I called 0x0015 ImageUniqueID. In fact, right now I can't find that tag in any of my samples at all.

Shall I change the tag value to 0x0016 here and make a note of the discrepancy with http://owl.phy.queensu.ca/~phil/exiftool/TagNames/Apple.html?

drewnoakes commented 5 years ago

@BobJohnsonGitHub thank you for this. I am currently in the process of moving country and don't have a lot of bandwidth. I encourage others to provide feedback here, and I'll provide a review as time permits.

scrappydog commented 4 years ago

@BobJohnsonGitHub iPhone 8 Plus potential Unique ID's

Apple Makernote - Unknown tag (0x0020) = 57E29167-7C4B-44BF-BC68-4280C6951F7F Apple Makernote - Unknown tag (0x002b) = 054B8D8A-9250-4F2E-986C-B91A91F0A8C0

Do these tags vary based on Camera model?

scrappydog commented 4 years ago

@BobJohnsonGitHub

iPhone 6 - This smells like UUID (no guids found in meta data)

Apple Makernote - Unknown tag (0x0018) = AQCrunJxXx4X6kaWWCP6eL9bKpi1

drewnoakes commented 4 years ago

@scrappydog thank you for drawing my attention to this PR again.

@BobJohnsonGitHub apologies it took over a year to get to this. I've been doing a bit of work on the library again during the quarantine. Your changes look good and I've merged them with a few minor tweaks. Thanks very much.

drewnoakes commented 4 years ago

@scrappydog if you're able to extract more info from the Apple makernote, a PR would be great.

nosnhojbob commented 4 years ago

Thanks for the merge, @drewnoakes

nosnhojbob commented 4 years ago

@drewnoakes - given @scrappydog comments on the ImageUniqueId, should we open a separate issue to track? From my initial research, it looked like 0x0015 was just invalid (per the ExifTool forum) and 0x0016 was the right tag. But it appears that there might be more candidate tags within Apple metadata. (see the earlier comments on this PR)

drewnoakes commented 4 years ago

If new tags are identified we can add support for them. Creating a new issue or pr is the best way. To answer an earlier question, yes these tags often vary by camera model.