This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libjpeg - header file is broken ?


Sven Köhler wrote:

 > libgd didn't compile - the progressive_mode in the
 > jpeg_decompress_struct was missing. i downloaded libjpeg and
 > installed that one (which was in fact the same version than that
 > installed by cygwin-setup)

No, it is not.  If you (a) had downloaded the jpeg6b-3-src.tar.gz file 
from sourceware, or (b) read /usr/doc/Cygwin/jpeg-6b.README, you would 
realize that...

 > now libgd does compile ...

the cygwin version has had the lossless jpeg patch applied.  This 
changes some internal data structures inside the jpeg library -- which 
ARE NOT SUPPOSED TO BE ACCESSED BY CLIENT PROGRAMS.

See this thread:

http://www.cygwin.com/ml/cygwin-apps/2001-02/msg00000.html

However, if you *must* access these things, then make these changes in 
your code:

cinfo->progressive_mode ---> (cinfo->process == JPROC_PROGRESSIVE)
cinfo->min_DCT_scaled_size ---> cinfo->min_codec_data_unit
cinfo->coef ---> cinfo->codec
cinfo->blocks_in_MCU ---> cinfo->data_units_in_MCU
D_MAX_BLOCKS_IN_MCU ---> D_MAX_DATA_UNITS_IN_MCU
C_MAX_BLOCKS_IN_MCU ---> C_MAX_DATA_UNITS_IN_MCU
DCTSIZE ---> cinfo->data_unit
MCU_blocks ---> MCU_data_units
DCT_scaled_size ---> codec_data_unit

(There may be others; check the ljpeg patch for details.  This patch is 
included in the sourceware distribution of jpeg-6b-3-src.tar.gz, or can 
be obtained from ftp.simplesystems.org)


The netpbm package 'solved' this problem by doing the following:

------------
/* With the lossless jpeg patch applied to the Jpeg library
(ftp://ftp.wizards.dupont.com/pub/ImageMagick/delegates/ljpeg-6b.tar.gz),
     the name of min_DCT_scaled_size changes to min_codec_data_unit,
     for some reason.  With this macro, we change it back.
*/
#define min_codec_data_unit min_DCT_scaled_size
#include <jpeglib.h>
#undef min_codec_data_unit
-------------

(Out of the jpeg private definitions modified by the lossless patch, 
netpbm only tries to access "min_DCT_scaled_size".  Therefore, netpbm 
only needs to worry about that one, and not any of the others)

--Chuck


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]