Detecting "Warning: Bad InteropIFD directory"

Started by mercator, March 15, 2015, 03:58:47 PM

Previous topic - Next topic

mercator

Good evening
I am currently migrating all my images from one image manager to another. The new one does not import all images and the problem seem to be corrupt IFD0 data.
I would like to fix that using the exiftool but want only to touch that 5% of data that actually have that problem. Can I use a command that only READS my jpg and ends with the error message

Warning: Bad InteropIFD directory

For those files I would then run

exiftool -all= -tagsfromfile @ -all:all -unsafe

Is that possible with exiftool?

Thanks,
Mercator

Phil Harvey

Hi Mercator,

If you get that warning when reading the image, then you could do something like this:

exiftool -if "$warning =~ /Bad InteropIFD/" ...

(the above quoting is for Windows.  Use single quotes instead on Mac/Linux.)

But if you only get the error when writing, or if there are other warnings when reading, we would have to find some other way to identify these files.

- 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 ($).

mercator

Hi Phil,

Thzanks fo your reply. I actually only get the error message when I write the file using exiftool -all= -tagsfromfile @ -all:all -unsafe. What I would need is an "inegrity checker" for IFD0 compliance that only checks and does not write. I got about 40'000 images with morethan 600GB of data which are externally backed up. It would take me ages to upload 600GB and in any case I would prefer to only touch the files that make trouble in the first place.

Anything you can think of I could do?

Thanks,
Mercator


Phil Harvey

Hi Mercator,

I just tested this on some samples here.  You should get this warning when reading, but there could be other warnings that hide this one unless you use -a to allow duplicate tags.  Unfortunately, the -if only tests one warning tag.  So doing this will ExifTool would be difficult.

But I can use the grep utility to search through all warnings like this:

exiftool -r -T -a -directory -filename -warning DIR | grep "Bad InteropIFD"

where DIR is the root directory containing the images.

This command will list the directory, file name, and all warnings for each applicable file in tab-separated format.

If you want to rebuild these files, the next step would be to take the first two columns of the output, put a "/" between them, and feed them back to ExifTool as a -@ argfile.

- 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 ($).

mercator

Good evening Phil,
This was really a great input and allowed me to identify the relevant files that need re-building. Thanks for the great support from your end!
Again, thanks a lot and should you come to Switzerland some day, please, drop me a line!
Mercator

Phil Harvey

Hi Mercator,

Thanks for the offer.  I'm glad I could help out.

- 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 ($).