changeset 7:c0045d8d3ce2 0.1

improved comment at begin of source; some cleanups
author meillo@marmaro.de
date Sat, 14 Jun 2008 12:33:33 +0200
parents e020f26c2c6a
children 6f0826fdec50
files resize-gd.c
diffstat 1 files changed, 7 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/resize-gd.c	Sat Jun 14 12:19:35 2008 +0200
+++ b/resize-gd.c	Sat Jun 14 12:33:33 2008 +0200
@@ -1,21 +1,17 @@
 /*
- * compile with: gcc -lgd -lpng -lz -ljpeg  -lm resize-gd.c
+ * resize-gd - resizes images using the gd-library
+ *
+ * Copyright 2008 by markus schnalke <meillo@marmaro.de>
+ *
  * build-depends: libgd2-noxpm-dev | libgd2-dev
  * depends: libgd2-noxpm | libgd2-xpm
- *
- *
- *
- * http://www.libgd.org/ImageCreation
- * http://cpan.uwinnipeg.ca/htdocs/Image-Resize/Image/Resize.pm.html
- * http://netpbm.sourceforge.net/
- *
  */
 
 #include <stdio.h>
-#include <stdlib.h>  /* for atoi() */
+#include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include "gd.h" /* Bring in the gd library functions */
+#include "gd.h"
 
 #define PROGRAM "resize-gd"
 #define VERSION "0.1"
@@ -142,25 +138,14 @@
 			fprintf(stderr, "'%s' has unknown filetype. Filename must end with (lowercase) '.png' or '.jpg'.\n", argv[i]);
 			continue;
 		}
+
 		/* load image */
 		in = fopen(argv[i], "rb");
-
 		if (type == Png) {
 			im_in = gdImageCreateFromPng(in);
 		} else if (type == Jpg) {
 			im_in = gdImageCreateFromJpeg(in);
 		}
-		/*
-		if ((im_in = gdImageCreateFromPng(in)) != NULL) {
-			type = Png;
-		} else if ((im_in = gdImageCreateFromJpeg(in)) != NULL) {
-			type = Jpg;
-		} else {
-			fprintf(stderr, "'%s' has unknown filetype. Filename must end with (lowercase) '.png' or '.jpg'.\n", argv[i]);
-			continue;
-		}
-		*/
-
 		fclose(in);
 
 		/* calculate target size */