[Gdal-dev] TIFF with JPEG compression on Win32
Frank Warmerdam
warmerdam at pobox.com
Fri Oct 1 09:53:29 EDT 2004
Julien Demaria wrote:
> Hi,
>
> I don't know why but my gdal Win32 build doesn't support read or write
> TIFF with JPEG compression, but my Linux and Solaris builds work well :
>
> read error:
> Input file size is 2044, 1704
> 0.ERROR 1: JPEGLib:JPEG parameter struct mismatch: library thinks size
> is 464, caller expects 432
> Assertion failed: sp->cinfo.comm.is_decompressor, file tif_jpeg.c, line 606
>
> write error:
> Input file size is 2044, 1704
> 0.ERROR 1: JPEGLib:JPEG parameter struct mismatch: library thinks size
> is 376, caller expects 360
> ERROR 1: JPEGLib:Improper call to JPEG library in state 0
> ERROR 1: TIFFWriteScanline failed.
> ERROR 1: JPEGLib:JPEG parameter struct mismatch: library thinks size is
> 376, caller expects 360
>
> I compile my Win32 build with VC6 with netCDF, MrSID 4 and Kakadu
> support and with /Ox /MD /EHsc flags and /NODEFAULTLIB:LIBC linker flag.
>
> I've tested with the OpenEV_FW 1.8.2 package and it works well...
>
> If anyone has ideas of the causes, or similar problem....
Julien,
This is a common problem. Are you building with an external libjpeg or
the built in copy? The built-in copy is supposed to work fine but there
are things that need to be tweaked with an external copy. Andrey knows the
details but he may not be able to answer email today.
I ended up hacking tif_jpeg.c for my OpenEV_FW 1.8.2 build a bit but Andrey's
suggestion was actually to slightly modify the jconfig.h file in libjpeg.
However, I didn't keep track of the details.
It all relates to differing sizes for the bool type, and the need to keep
them consistent between how things are built for tif_jpeg.c and within libjpeg
itself. If you search for "boolean" in tif_jpeg.c you will see some
discussion of the issue. There is also at least one bugzilla report on
the problem though I don't have a link off hand.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list