2019.11.11 16:20 "[Tiff] OJpeg files in 4.1.0 no longer display in my viewer", by Laube, Warren

2019.11.11 22:16 "Re: [Tiff] OJpeg files in 4.1.0 no longer display in my viewer", by Even Rouault

Warren,

I've a proposed fix in https://gitlab.com/libtiff/libtiff/merge_requests/97 that still passes on my zackthecat file, on your two images and reject the corrupted image that was rejected by the previously wrong test. I feel much better about the checks I added than the previous contributed checks that I couldn't really make sense of.

I'd appreciate if you and other people having OJPEG files could confirm that the above fix works.

Even

Please file a ticket on https://gitlab.com/libtiff/libtiff/ and attach (or provide a link) to such a file.

Must be related to some formulations of OJPEG. At least https://github.com/OSGeo/gdal/blob/master/autotest/gcore/data/zackthecat.tif can still be processed. This is actually the only OJPEG file I've accessed to. Some others like yours, made available under a free license, could be helpful.

Even

1On lundi 11 novembre 2019 16:20:35 CET Laube, Warren wrote:

I've just upgraded to libTiff 4.1.0 from 4.0.10 and have noticed a problem opening Tiff files with OJpeg compression. Files displaying correctly in 4.0.10 no longer work in 4.1.0 and I have traced the issue to new code added in 4.1.0 in tif_ojpeg.c around line 866 shown below. I now get this "Inconsistent number of MCU in codestream" error message and no image. Commenting out this error check code allows my images to be displayed again.

if (jpeg_bytes != expected_bytes)
       {
              TIFFErrorExt(tif->tif_clientdata,module,"Inconsistent number of MCU in codestream");
              sp->error_in_raw_data_decoding = 1;
              return(0);
       }

Are others seeing this issue and can this code be fixed to allow my images to work again?

--
Spatialys - Geospatial professional services
http://www.spatialys.com