JPEG compressed TIFF images and libtiff CVS head

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown JPEG compressed TIFF images and libtiff CVS head

by Richard Nolde-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,
I am continuing my investigation of JPEG related issues with libtiff CVS
Head.

Since I can read any uncompressed image, any LZW, Packbits, etc and MOST
jpeg in TIFF images and save them as uncompressed TIFF or even with new
JPEG compression, I am beginning to wonder if this is related to the
specific version of libjpeg that I am using.  Would anybody be willing
to compile my current tiffcrop.c and try to read/write jpeg compressed
images with it?

Using an unmodified tiffcp compiled with  libtiff CVS head as my
reference, I see problems with OJPEG images, but not new JPEG images.

tiffcp -c jpeg /archive/libtiff/libtiffpic/smallliz.tif
/tmp/tiff/smallliz-jpeg.tif
OJPEGSetupDecode: Warning, Depreciated and troublesome old-style JPEG
compression mode, please convert to new-style JPEG compression and
notify vendor of writing software.
JPEGLib: Application transferred too few scanlines.
/tmp/tiff/smallliz-jpeg.tif: Error, can't write strip 0.

tiffcp -c jpeg /archive/libtiff/libtiffpic/zackthecat.tif
/tmp/tiff/zackthecat.tif
OJPEGSetupDecode: Warning, Depreciated and troublesome old-style JPEG
compression mode, please convert to new-style JPEG compression and
notify vendor of writing software.
Segmentation fault

tiffcp -c jpeg /archive/libtiff/libtiffpic/quad-jpeg.tif
/tmp/tiff/quad-jpeg.tif

---------------------
My working copy of tiffcrop can read and write all of these (emitting a
warning about the returned size for TIFFTileSize or TIFFStripSize and
adjusting the buffer size to prevent the segfault) but it produces
images that are compressed in the vertical dimension by 1/2 of the
original height, leaving the bottom half of the image blank.  The color
information is off, the results appear to represent a mishandling of the
chroma information since the image is recognizable even with the
vertical distortion.

./tiffcroptest -c jpeg /archive/libtiff/libtiffpic/smallliz.tif
/tmp/tiff/smallliz-jpeg.tif
loadImage: Stripsize 38400 is too small, using imagelength * width * spp
* bps / 8 = 76800.
OJPEGSetupDecode: Warning, Depreciated and troublesome old-style JPEG
compression mode, please convert to new-style JPEG compression and
notify vendor of writing software.

./tiffcroptest -c jpeg /archive/libtiff/libtiffpic/zackthecat.tif
/tmp/tiff/zackthecat-jpeg.tif
loadImage: Tilesize 80640 is too small, using ntiles * tilelength *
tilerowsize 161280.
readContigTilesIntoBuffer: Tilesize 80640 is too small, using alternate
calculation 161280.
OJPEGSetupDecode: Warning, Depreciated and troublesome old-style JPEG
compression mode, please convert to new-style JPEG
compression and notify vendor of writing software.

./tiffcroptest -c jpeg /archive/libtiff/libtiffpic/quad-jpeg.tif
/tmp/tiff/quad-jpeg-newjpeg.tif
loadImage: Stripsize 12288 is too small, using imagelength * width * spp
* bps / 8 = 589824.

rpm -q libjpeg
libjpeg-6b-45.fc11.i586

ls -l /usr/lib/*jpeg*
-rwxr-xr-x. 1 root root 139052 2009-02-25 09:08 /usr/lib/libjpeg.so.62.0.0
-rwxr-xr-x. 1 root root 116144 2009-06-19 09:14
/usr/lib/libopenjpeg.so.2.1.3.0
-rw-r--r--. 1 root root 154644 2009-06-30 16:18 /usr/lib/libopenjpeg.a
-rwxr-xr-x. 1 root root 119588 2009-06-30 16:18
/usr/lib/libopenjpeg-2.1.3.0.so

I will send the source code to anyone who is willing to compile and test it.

Richard Nolde
Tiffcrop author
_______________________________________________
Tiff mailing list: Tiff@...
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/