Source

gd-libgd / src / gd_png.c

Diff from to

src/gd_png.c

-
-#ifdef HAVE_LIBPNG
-
 #include <stdio.h>
 #include <math.h>
 #include <string.h>
 #include <stdlib.h>
 #include "gd.h"
+
+/* JCE: Arrange HAVE_LIBPNG so that it can be set in gd.h */
+#ifdef HAVE_LIBPNG
+
 #include "gdhelpers.h"
 #include "png.h"		/* includes zlib.h and setjmp.h */
 
   gdImagePtr im;
   gdIOCtx *in = gdNewFileCtx (inFile);
   im = gdImageCreateFromPngCtx (in);
-  in->free (in);
+  in->gd_free (in);
   return im;
 }
 
   png_bytep image_data = NULL;
   png_bytepp row_pointers = NULL;
   gdImagePtr im = NULL;
-  int i, j, *open;
+  int i, j, *open = NULL;
   volatile int transparent = -1;
   volatile int palette_allocated = FALSE;
 
 {
   gdIOCtx *out = gdNewFileCtx (outFile);
   gdImagePngCtx (im, out);
-  out->free (out);
+  out->gd_free (out);
 }
 
 void *
   gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
   gdImagePngCtx (im, out);
   rv = gdDPExtractData (out, size);
-  out->free (out);
+  out->gd_free (out);
   return rv;
 }
 
 void
 gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile)
 {
-  int i, j, bit_depth, interlace_type;
+  int i, j, bit_depth = 0, interlace_type;
   int width = im->sx;
   int height = im->sy;
   int colors = im->colorsTotal;
       int i;
       int j;
       int k;
-      int highTrans = -1;
       for (i = 0; (i < im->colorsTotal); i++)
 	{
 	  if ((!im->open[i]) &&
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.