Commits

Pierre Joye committed 1aa7ad8

fix examples build

  • Participants
  • Parent commits 6007934

Comments (0)

Files changed (4)

File examples/arc.c

 		gdImageDestroy(im);
 		return 1;
 	}
+#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
+#else
+	printf("No PNG support. Cannot save image.\n");
+#endif
 	fclose(fp);
 
 	gdImageDestroy(im);

File examples/crop.c

 		fprintf(stderr, "Can't save png image %s\n", filename);
 		return;
 	}
+#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
+#else
+	printf("No PNG support. Cannot save image.\n");
+#endif
 	fclose(fp);
 }
 
 		fprintf(stderr, "Can't read png image %s\n", filename);
 		return NULL;
 	}
+#ifdef HAVE_LIBPNG
 	im = gdImageCreateFromPng(fp);
+#else
+	printf("No PNG support. Cannot read image.\n");
+#endif
 	fclose(fp);
 	return im;
 }
 	gdImageRectangle(im, 19, 29, 390, 390, 0xFF0000);
 	save_png(im, "a1.png");
 
-	im2 = gdImageAutoCrop(im, GD_CROP_SIDES);
+	im2 = gdImageCropAuto(im, GD_CROP_SIDES);
 	if (im2) {
 		save_png(im2, "a2.png");
 		gdImageDestroy(im2);
 		return 1;
 	}
 
-	im2 = gdImageThresholdCrop(im, 0xFFFFFF, 0.6);
+	im2 = gdImageCropThreshold(im, 0xFFFFFF, 0.6);
 	if (im2) {
 		save_png(im2, "a4.png");
 		gdImageDestroy(im2);

File examples/nnquant.c

 		fprintf(stderr, "Can't save png image %s\n", filename);
 		return;
 	}
+#ifdef HAVE_LIBPNG
 	gdImagePng(im, fp);
+#else
+	printf("No PNG support. Cannot save image.\n");
+#endif
 	fclose(fp);
 }
 

File examples/tgaread.c

 			gdImageDestroy(im);
 			return 1;
 		}
-
-		gdImagePng(im, fp);
+#ifdef HAVE_LIBPNG
+	gdImagePng(im, fp);
+#else
+	printf("No PNG support. Cannot save image.\n");
+#endif
 		fclose(fp);
 		gdImageDestroy(im);
 	}