Writing to the ExifIFD group also affecting IFD0 group

Started by odog502, February 26, 2015, 01:49:00 AM

Previous topic - Next topic

odog502

Hi, Long time user of the tool and was trying something new today and got unexpected results.

I ran this command expecting that it would update all date values in the ExifIFD group to the date specified below
exiftool -overwrite_original -ExifIFD:time:all="2005:5:5 5:30:0" .

This is before running the command:
======== ./File1.jpg
[IFD0]          Modify Date                     : 1999:01:01 01:30:00
[ExifIFD]       Date/Time Original              : 1999:01:01 01:30:00
[ExifIFD]       Create Date                     : 1999:01:01 01:30:00


This is after running the command:
======== ./File1.jpg
[ExifIFD]       Modify Date                     : 2005:05:05 05:30:00
[ExifIFD]       Date/Time Original              : 2005:05:05 05:30:00
[ExifIFD]       Create Date                     : 2005:05:05 05:30:00


It updated the date properly but also changed the Modify Date property from the IFD0 group to the ExifIFD group.  Now when exporting the EXIF data for those files it gives an error about "Warning: Bad GeoTIFF directory".  It did the opposite when I used IFD0 in the command instead of ExifIFD.  It would change all of those date tags to the IFD0 group.  It did this for all pictures of varying camera maker and models.  I downloaded the newest version of ExifTool(9.87), tried it again and got the same results.

I imagine this isn't expected behavior since it appears to have possibly corrupted the metadata.  Am I using the command incorrectly?

Phil Harvey

#1
Wow, you're right!

Unfortunately some utilities write EXIF tags in the wrong IFD (specifically, there is a confusion between IFD0 and ExifIFD).  ExifTool has some special code to deal with this mess, and unfortunately it seems that a bug in this code causes the other group to be ignored when a specific IFD group is specified together with another group.  (So your command effectively behaved as if you set ExifIFD:all.)

This will be fixed in ExifTool 9.88.

Thanks for pointing out this bug!

- Phil

Edit: Until 9.88 is released, a work-around is to specify the families explicitly.  eg) -1exififd:2time:all=...
...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 ($).

odog502

That's great.  I look forward to the fix in the next release.

Thank you for being so dedicated and diligently keeping this awesome tool up to date over the years!