Source

gd-libgd / src / gdtest.c

Diff from to

File src/gdtest.c

 int
 main (int argc, char **argv)
 {
+#ifdef HAVE_LIBPNG
   gdImagePtr im, ref, im2, im3;
   FILE *in, *out;
   void *iptr;
   CompareImages ("GD->PNG ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->free (ctx);
+  ctx->gd_free (ctx);
 
 
   /* */
   CompareImages ("GD->GD2 ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->free (ctx);
+  ctx->gd_free (ctx);
 
 
   /* */
   CompareImages ("GD->GD ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->free (ctx);
+  ctx->gd_free (ctx);
 
   /*
      ** Test gdImageCreateFromPngSource'
   gdImageDestroy (im2);
   gdImageDestroy (im3);
 
-#ifdef HAVE_JPEG
+#ifdef HAVE_LIBJPEG
   out = fopen ("test/gdtest.jpg", "wb");
   if (!out)
     {
   printf ("Created test/gdtest.jpg successfully. Compare this image\n"
 	  "to the input image manually. Some difference must be\n"
 	  "expected as JPEG is a lossy file format.\n");
-#endif /* HAVE_JPEG */
+#endif /* HAVE_LIBJPEG */
   /* Assume the color closest to black is the foreground
      color for the B&W wbmp image. */
   fprintf (stderr, "NOTE: the WBMP output image will NOT match the original unless the original\n"
     }
   gdImageDestroy (im);
   gdImageDestroy (ref);
+#else
+  fprintf(stderr, "No PNG library support.\n");
+#endif /* HAVE_LIBPNG */
 
   return 0;
 }