# HG changeset patch # User meillo@marmaro.de # Date 1213439613 -7200 # Node ID c0045d8d3ce21d3a33e789ac68283168a72a613e # Parent e020f26c2c6a5d32a2932be0e31f701f62283476 improved comment at begin of source; some cleanups diff -r e020f26c2c6a -r c0045d8d3ce2 resize-gd.c --- 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 + * * 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 -#include /* for atoi() */ +#include #include #include -#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 */