avoid non init'ed im if no png support
parent
e7a8d065f5
commit
e5b9482db4
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue