Commits

Anonymous committed b77f755

- sync to 2.0.24

Comments (0)

Files changed (3)

 #else
 	  r = gdTrueColorGetRed (*inptr);
 	  g = gdTrueColorGetGreen (*inptr);
-	  b = gdTrueColorGetBlue (*inptr++);
+	  /* 
+	     2.0.24: inptr must not be incremented until after
+	     transparency check, if any. Thanks to "Super Pikeman." 
+	   */
+	  b = gdTrueColorGetBlue (*inptr);
 
 	  /* If the pixel is transparent, we assign it the palette index that
 	   * will later be added at the end of the palette as the transparent
 	  if ((im->transparent >= 0) && (im->transparent == *inptr))
 	    {
 	      *outptr++ = im->colorsTotal;
+	      inptr++;
 	      continue;
 	    }
+	  inptr++;
 #endif
 	  c0 = r >> C0_SHIFT;
 	  c1 = g >> C1_SHIFT;
 GLOBAL (void)
 jinit_2pass_quantizer (j_decompress_ptr cinfo)
 #else
-void
-gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
+BGD_DECLARE(void) gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
 #endif
 {
   my_cquantize_ptr cquantize = NULL;
    **          considered as background and will not be written
    **  out:    the stream where to write
  */
-void
-gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
+BGD_DECLARE(void) gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
 {
 
   int x, y, pos;
    ** ------------------------
    ** Create a gdImage from a WBMP file input from an gdIOCtx
  */
-gdImagePtr
-gdImageCreateFromWBMPCtx (gdIOCtx * infile)
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx (gdIOCtx * infile)
 {
   /* FILE *wbmp_file; */
   Wbmp *wbmp;
 /* gdImageCreateFromWBMP
    ** ---------------------
  */
-gdImagePtr
-gdImageCreateFromWBMP (FILE * inFile)
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMP (FILE * inFile)
 {
   gdImagePtr im;
   gdIOCtx *in = gdNewFileCtx (inFile);
   return (im);
 }
 
-gdImagePtr
-gdImageCreateFromWBMPPtr (int size, void *data)
+BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPPtr (int size, void *data)
 {
   gdImagePtr im;
   gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
 /* gdImageWBMP
    ** -----------
  */
-void
-gdImageWBMP (gdImagePtr im, int fg, FILE * outFile)
+BGD_DECLARE(void) gdImageWBMP (gdImagePtr im, int fg, FILE * outFile)
 {
   gdIOCtx *out = gdNewFileCtx (outFile);
   gdImageWBMPCtx (im, fg, out);
 			       gdCacheFetchFn_t gdCacheFetch,
 			       gdCacheReleaseFn_t gdCacheRelease);
 
- BGD_EXPORT void gdCacheDelete (gdCache_head_t * head);
+void gdCacheDelete (gdCache_head_t * head);
 
 void *gdCacheGet (gdCache_head_t * head, void *keydata);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.