AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2006.10.26 15:21 "[Tiff] TIFFReadPrivateDirectory function is not working for SUBIFD", by Anurag Singh
2006.10.26 18:34 "Re: [Tiff] TIFFReadPrivateDirectory function is not working for SUBIFD", by Sebastian Boehmer
2006.10.27 06:34 "Re: [Tiff] TIFFReadPrivateDirectory function is not working for SUBIFD", by Anurag Singh
2006.10.27 19:11 "Re: [Tiff] TIFFReadPrivateDirectory function is not working for SUBIFD", by Sebastian Boehmer

2006.10.26 15:21 "[Tiff] TIFFReadPrivateDirectory function is not working for SUBIFD", by Anurag Singh

Hello All

I am trying to read subIFD with the help of TIFFReadPrivateDirectory(TIFF* tif, toff_t diroff), but finally got that it's not working.

this is the code snippet of the function

__TIFFReadCustomDirectoryPart(TIFF* tif, toff_t diroff, size_t* nfields, TIFFFieldInfo** info[], int attrPrivateDirectory ) {

 fix = 0;

for (dp = dir, i = dircount; i > 0; i--, dp++) {

      if (tif->tif_flags & TIFF_SWAB) {

         TIFFSwabArrayOfShort(&dp->tdir_tag, 2);

       TIFFSwabArrayOfLong(&dp->tdir_count, 2);

     }

   if (fix >= *nfields || dp->tdir_tag == IGNORE)

  continue;

// none of the line executed below it

 while (fix < *nfields && (*info)[fix]->field_tag < dp->tdir_tag)

  fix++;

}

 }

above nfields is tif->tif_nPrivateFields, which is always 0 at the time of SubIFD reading. So the loop never complete, it's always return from the same line.

Please let me know how to read SubIFD with the help of the above fucntions.

Thanks In Advance

Anurag