Handle patched jpeg library found on CYGWIN.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2008-08-08 14:08:54 +00:00
parent fd45064a83
commit d650fce161
2 changed files with 18 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-08-08 Adam Fedor <fedor@gnu.org>
* Source/NSBitmapImageRep+JPEG.m: Handle patched jpeg library
found on CYGWIN.
2008-08-07 18:23-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Headers/AppKit/NSTokenFieldCell.h

View file

@ -50,6 +50,10 @@
#endif
#endif
#include <jpeglib.h>
#if defined(__CYGWIN__)
/* Cygwin uses a patched jpeg */
#define GSTEP_PROGRESSIVE_CODEC
#endif
#include <setjmp.h>
@ -465,7 +469,11 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo)
}
}
#ifdef GSTEP_PROGRESSIVE_CODEC
isProgressive = (cinfo.process == JPROC_PROGRESSIVE);
#else
isProgressive = cinfo.progressive_mode;
#endif
/* done */
jpeg_finish_decompress(&cinfo);
@ -599,7 +607,12 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo)
progressiveNumber = [properties objectForKey: NSImageProgressive];
if (progressiveNumber != nil)
{
#ifdef GSTEP_PROGRESSIVE_CODEC
if ([progressiveNumber boolValue])
cinfo.process = JPROC_PROGRESSIVE;
#else
cinfo.progressive_mode = [progressiveNumber boolValue];
#endif
}