avoid non init'ed im if no png support

master
Pierre Joye 2013-04-04 16:56:13 +02:00
parent e7a8d065f5
commit e5b9482db4
2 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ gdImagePtr read_png(const char *filename)
#ifdef HAVE_LIBPNG
im = gdImageCreateFromPng(fp);
#else
im = NULL;
printf("No PNG support. Cannot read image.\n");
#endif
fclose(fp);

View File

@ -33,6 +33,7 @@ main (int argc, char **argv)
#ifdef HAVE_LIBPNG
im = gdImageCreateFromPng (in);
#else
im = NULL;
fprintf (stderr, "No PNG library support available.\n");
#endif
fclose (in);