Source

gd-libgd / src / gdtest.c

Diff from to

src/gdtest.c

-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 	int foreground;
 	int i;
 	if (argc != 2) {
-		fprintf (stderr, "Usage: gdtest filename.png\n");
+		fprintf(stderr, "Usage: gdtest filename.png\n");
 		exit (1);
 	}
 	in = fopen (argv[1], "rb");
 	if (!in) {
-		fprintf (stderr, "Input file does not exist!\n");
+		fprintf(stderr, "Input file does not exist!\n");
 		exit (1);
 	}
 	im = gdImageCreateFromPng (in);
 
 	in = fopen (of, "rb");
 	if (!in) {
-		fprintf (stderr, "PNG Output file does not exist!\n");
+		fprintf(stderr, "PNG Output file does not exist!\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromPng (in);
 
 	in = fopen (of, "rb");
 	if (!in) {
-		fprintf (stderr, "GD2 Output file does not exist!\n");
+		fprintf(stderr, "GD2 Output file does not exist!\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromGd2 (in);
 
 	in = fopen (of, "rb");
 	if (!in) {
-		fprintf (stderr, "GD Output file does not exist!\n");
+		fprintf(stderr, "GD Output file does not exist!\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromGd (in);
 	/* */
 	in = fopen ("test/gdtest_200_300_150_100.png", "rb");
 	if (!in) {
-		fprintf (stderr, "gdtest_200_300_150_100.png does not exist!\n");
+		fprintf(stderr, "gdtest_200_300_150_100.png does not exist!\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromPng (in);
 
 	in = fopen ("test/gdtest.gd2", "rb");
 	if (!in) {
-		fprintf (stderr, "gdtest.gd2 does not exist!\n");
+		fprintf(stderr, "gdtest.gd2 does not exist!\n");
 		exit (1);
 	}
 	im3 = gdImageCreateFromGd2Part (in, 200, 300, 150, 100);
 	/* */
 	in = fopen ("test/gdtest.png", "rb");
 	if (!in) {
-		fprintf (stderr, "gdtest.png does not exist!\n");
+		fprintf(stderr, "gdtest.png does not exist!\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromPng (in);
 
 	in = fopen ("test/gdtest_merge.png", "rb");
 	if (!in) {
-		fprintf (stderr, "gdtest_merge.png does not exist!\n");
+		fprintf(stderr, "gdtest_merge.png does not exist!\n");
 		exit (1);
 	}
 	im3 = gdImageCreateFromPng (in);
 #ifdef HAVE_LIBJPEG
 	out = fopen ("test/gdtest.jpg", "wb");
 	if (!out) {
-		fprintf (stderr, "Can't create file test/gdtest.jpg.\n");
+		fprintf(stderr, "Can't create file test/gdtest.jpg.\n");
 		exit (1);
 	}
 	gdImageJpeg (im, out, -1);
 	fclose (out);
 	in = fopen ("test/gdtest.jpg", "rb");
 	if (!in) {
-		fprintf (stderr, "Can't open file test/gdtest.jpg.\n");
+		fprintf(stderr, "Can't open file test/gdtest.jpg.\n");
 		exit (1);
 	}
 	im2 = gdImageCreateFromJpeg (in);
 	fclose (in);
 	if (!im2) {
-		fprintf (stderr, "gdImageCreateFromJpeg failed.\n");
+		fprintf(stderr, "gdImageCreateFromJpeg failed.\n");
 		exit (1);
 	}
 	gdImageDestroy (im2);
 	         "NOTE: the WBMP output image will NOT match the original unless the original\n"
 	         "is also black and white. This is OK!\n");
 	foreground = gdImageColorClosest (im, 0, 0, 0);
-	fprintf (stderr, "Foreground index is %d\n", foreground);
+	fprintf(stderr, "Foreground index is %d\n", foreground);
 	if (foreground == -1) {
-		fprintf (stderr, "Source image has no colors, skipping wbmp test.\n");
+		fprintf(stderr, "Source image has no colors, skipping wbmp test.\n");
 	} else {
 		out = fopen ("test/gdtest.wbmp", "wb");
 		if (!out) {
-			fprintf (stderr, "Can't create file test/gdtest.wbmp.\n");
+			fprintf(stderr, "Can't create file test/gdtest.wbmp.\n");
 			exit (1);
 		}
 		gdImageWBMP (im, foreground, out);
 		fclose (out);
 		in = fopen ("test/gdtest.wbmp", "rb");
 		if (!in) {
-			fprintf (stderr, "Can't open file test/gdtest.wbmp.\n");
+			fprintf(stderr, "Can't open file test/gdtest.wbmp.\n");
 			exit (1);
 		}
 		im2 = gdImageCreateFromWBMP (in);
-		fprintf (stderr, "WBMP has %d colors\n", gdImageColorsTotal (im2));
-		fprintf (stderr, "WBMP colors are:\n");
+		fprintf(stderr, "WBMP has %d colors\n", gdImageColorsTotal (im2));
+		fprintf(stderr, "WBMP colors are:\n");
 		for (i = 0; (i < gdImageColorsTotal (im2)); i++) {
-			fprintf (stderr, "%02X%02X%02X\n",
+			fprintf(stderr, "%02X%02X%02X\n",
 			         gdImageRed (im2, i),
 			         gdImageGreen (im2, i), gdImageBlue (im2, i));
 		}
 		fclose (in);
 		if (!im2) {
-			fprintf (stderr, "gdImageCreateFromWBMP failed.\n");
+			fprintf(stderr, "gdImageCreateFromWBMP failed.\n");
 			exit (1);
 		}
 		CompareImages ("WBMP test (gdtest.png, gdtest.wbmp)", ref, im2);
 	gdImageDestroy (im);
 	gdImageDestroy (ref);
 #else
-	fprintf (stderr, "No PNG library support.\n");
+	fprintf(stderr, "No PNG library support.\n");
 #endif /* HAVE_LIBPNG */
 
 	return 0;