* gd_jpeg.c: Read and write JPEG (JFIF) format image files using the
* gd graphics library (http://www.libgd.org).
* This software is based in part on the work of the Independent JPEG
* Group. For more information on the IJG JPEG software (and JPEG
* documentation, etc.), see ftp://ftp.uu.net/graphics/jpeg/.
* 2.0.10: more efficient gdImageCreateFromJpegCtx, thanks to
- Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
- not defined. MinGW and Borland compilers include a typedef for INT32,
- which causes a conflict. MSVC does not include a conficting typedef
- given the headers which are included.
-#if defined(__BORLANDC__) || defined(__MINGW32__)
- Another possible conflict under MinGW
-#if defined(WIN32) && defined(__MINGW32__)
-# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
- typedef unsigned char boolean;
-# define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
/* JCE undef two symbols that we don't need anymore but which are
may be defined in config.h from ./configure but which are
static int CMYKToRGB(int c, int m, int y, int k, int inverted);
* Create a gd-format image from the JPEG-format INFILE. Returns the
* image, or NULL upon error.
printf("gd-jpeg: gd JPEG version %s\n", GD_JPEG_VERSION);
printf("gd-jpeg: JPEG library version %d, %d-bit sample values\n", JPEG_LIB_VERSION, BITS_IN_JSAMPLE);
+ printf("sizeof: %d\n", sizeof(struct jpeg_decompress_struct));
memset(&cinfo, 0, sizeof(cinfo));
* latest libjpeg, replaced by something else. Unfortunately
* there is still no right way to find out if the file was
* progressive or not; just declare your intent before you
- * write one by calling gdImageInterlace(im, 1) yourself.
+ * write one by calling gdImageInterlace(im, 1) yourself.
* After all, we're not really supposed to rework JPEGs and
* write them out again anyway. Lossy compression, remember? */
fprintf(stderr, "gd-jpeg: warning: jpeg_finish_decompress"
" reports suspended data source\n");
- /* TBB 2.0.29: we should do our best to read whatever we can read, and a
+ /* TBB 2.0.29: we should do our best to read whatever we can read, and a
* warning is a warning. A fatal error on warnings doesn't make sense. */
/* This was originally added by Truxton Fulton */
my_src_ptr src = (my_src_ptr)cinfo->src;
/* 2.0.12: signed size. Thanks to Geert Jansen */
- /* 2.0.14: some platforms (mingw-msys) don't have ssize_t. Call
+ /* 2.0.14: some platforms (mingw-msys) don't have ssize_t. Call