ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: mercator on March 15, 2015, 03:58:47 PM

Title: Detecting "Warning: Bad InteropIFD directory"
Post by: mercator on March 15, 2015, 03:58:47 PM
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
Title: Re: Detecting "Warning: Bad InteropIFD directory"
Post by: Phil Harvey on March 15, 2015, 08:24:46 PM
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
Title: Re: Detecting "Warning: Bad InteropIFD directory"
Post by: mercator on March 16, 2015, 07:00:26 AM
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

Title: Re: Detecting "Warning: Bad InteropIFD directory"
Post by: Phil Harvey on March 16, 2015, 08:19:50 AM
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
Title: Re: Detecting "Warning: Bad InteropIFD directory"
Post by: mercator on March 16, 2015, 01:59:17 PM
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
Title: Re: Detecting "Warning: Bad InteropIFD directory"
Post by: Phil Harvey on March 16, 2015, 02:02:51 PM
Hi Mercator,

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

- Phil