The "-fast2" flag skips most iPhone HEIC metadata on macOS but not Debian

Started by chrisfrank, October 17, 2023, 09:55:39 AM

Previous topic - Next topic

chrisfrank

Hi there,

Thanks for a truly amazing piece of software. We're very happy ExifTool users at The New York Times.

We extract metadata from incoming images with the "-fast2" flag, which in our experience does a great job of omitting Maker Notes we don't need and preserving the metadata fields we care about. In production, we currently run ExifTool 12.16 on Debian "bullseye", and everything works as expected.

During local development, I currently run macOS 13.5.2 and ExifTool 12.60, where it turns out "-fast2" omits much more data from iPhone HEIC images than I'd expect, including Orientation, Make, Model, DateTimeOriginal, LensModel, and more.

I've attached an example HEIC image, which I'm processing with this incantation:


exiftool -fast2 -use MWG -G -j IMG_1590.HEIC


If I convert that same image to JPEG and run exiftool with the same arguments, I do see Orientation, Make, Model, and all other fields I'm hoping for. I also see those fields when I process the original HEIC image with "-fast2" in our Debian environment.

Is this difference in behavior between macOS and Debian expected?


StarGeek

I believe this change would have happened in ver 12.50, Nov. 8, 2022

QuoteEnhanced -fast2 so it stops processing QuickTime files at mdat atom

HEIC are based upon the MP4 format. I would guess that the EXIF data is located after the mdat atom, though I don't know enough about the format to be sure.

You could always exclude the MakerNotes by adding
--MakerNotes:All

Or get only the tags you want
exiftool -EXIF:All -use MWG -G -j IMG_1590.HEIC

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Just to back up StarGeek's response...

From the exiftool application documentation:

            -fast2 also causes exiftool to avoid extracting any EXIF
            MakerNote information, and to stop processing at the IDAT chunk of
            PNG images and the mdat atom of QuickTime-format files (but note
            that some files may store metadata after this).


But for HEIC, the metadata is actually stored inside mdat along with the image data.  Reading this could result in the entire file being loaded.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Thinking about this more, maybe I should make an exception for HEIC files. ?

- Phil

Edit:  I've implemented this patch and done some testing.  Looking at an iPhone HEIC sample, the metadata seems to be toward the start of mdat, so it won't slow things down terribly.  Unless I say otherwise, I'll include this patch in version 12.69.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

chrisfrank

Thank you both so much, and sorry for the delay! I thought I had email notifications enabled but I did not.

I'll keep an eye out for that forthcoming patch, and if we end up upgrading our deployed exiftool version to something >= 12.50 that doesn't include this patch yet, it sounds like the "--MakerNotes:all" suggestion will work well.

Thanks again!


StarGeek

Quote from: chrisfrank on October 19, 2023, 11:37:37 AMI thought I had email notifications enabled but I did not.

You can set notifications per thread in the upper/lower right corners


You can set it for all your posts by clicking on your account in the upper left corner
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).