2004.07.17 11:22 "[Tiff] possible bug in JPEGDecode", by Aleksandar Zivkovic

2004.07.17 11:22 "[Tiff] possible bug in JPEGDecode", by Aleksandar Zivkovic

I tried to use libtiff with scanline-oriented interface (as described in document Using the TIFF Library).

It seems it doesn't work. In my wrapper I'm using TIFFReadScanline function.

It seems that the problem occures in JPEGDecode (OJPEGDecode) function. TIFFjpeg_finish_decompress (TIFFojpeg_finish_decompress) is called even if a strip (or tile) is not finished. I override this with a patch:

static int
OJPEGDecode(register TIFF *tif,tidata_t buf,tsize_t cc,tsample_t s)
  {
.................................
 /* AZ: Close down the decompressor if we've finished the strip or tile. */
 if (sp->cinfo.d.output_scanline >= sp->cinfo.d.output_height)     /* I think we must check this first */

ERRCHK(TIFFojpeg_finish_decompress(sp,&ret)); /* AZ */
    return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height
        || ret;
................................................
}

, So have I found a bug, or maybe Im not using scanline interface properly?

Best Regards,

Alexandar
e-mail:
Aleksandar.Zivkovic@micronasnit.com