2005.12.03 07:15 "[Tiff] Attempting to parse EXIF data (in a JPEG) with libtiff", by Joshua Muskovitz

2005.12.03 13:59 "Re: [Tiff] Attempting to parse EXIF data (in a JPEG) with libtiff", by Andrey Kiselev

On Sat, Dec 03, 2005 at 02:15:49AM -0500, Joshua Muskovitz wrote:

I'm trying to implement an JPEG/EXIF parser using libtiff. Separately, I am able to extract the EXIF block from the source jpeg image, and I can see that it has the proper "II" preamble for TIFF. I can also see the textual EXIF data within the block.

When I try to parse the data with libtiff, I fail in this logic in TIFFReadDirectory, called from TIFFClientOpen:

    if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
        MissingRequired(tif, "ImageLength");
        goto bad;
    }

which fails, and then I'm dumped out of the file and unable to parse it. Now valid EXIF blocks supposedly have no image data in the 0th IFD, and I suspect this is the reason it chokes.

As a reality check, I *am* able to parse actual TIFF image files using my libtiff wrappers, so I have confidence that that isn't the problem.

Am I nuts to be attempting this in the first place? Is there something obvious I'm missing here?

Joshua,

The current implementation does not allow to read custom directories. There will be a special call TIFFReadCustomDirectory() to read arbitrary IFD, but it is not implemented yet.

Regards,
Andrey

--
Andrey V. Kiselev

Home phone: +7 812 5970603 ICQ# 26871517