[Gdal-dev] TIFF with JPEG compression on Win32

Frank Warmerdam fwarmerdam at gmail.com
Thu Sep 8 11:55:40 EDT 2005


On 8/26/05, remedius <remedius at mail.ru> wrote:
>         
>   
>   
>  Hi! 
> I have the same problem: 
>  ERROR 1: JPEGLib:JPEG parameter struct mismatch: library thinks size is 
> > 376, caller expects 360
> do you know how to escape this problem. I have read that we can change jconfig.h file, but how we should do this in a proper way. Please, I need your help!
> remedius at mail.ru

Hi,

My normal hack to resolve this problem is to change the following code
in tif_jpeg.c:

/* Define "boolean" as unsigned char, not int, per Windows custom. */
#if defined(WIN32)
# ifndef __RPCNDR_H__            /* don't conflict if rpcndr.h already read */
   typedef unsigned char boolean;
# endif
# define HAVE_BOOLEAN            /* prevent jmorecfg.h from redefining it */
#endif

To this:

/* Define "boolean" as unsigned char, not int, per Windows custom. */
#define boolean int
#define HAVE_BOOLEAN


The core of the problem is that some include files define boolean
differently, but it is very important to have a consistent size for it 
in the jpeg structure regardless of whether you are in the tiff code
or libjpeg itself. 

Hopefully one of the future changes to libjpeg will be to get rid of
use of this generic boolean type in favor of something unlikely
to suffer from conflicts. 

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