PNG files couldn't be read anymore

This commit is contained in:
natureh 510
2013-01-11 00:33:43 +01:00
parent 5aeedda116
commit 5e261ce8d4

View File

@@ -178,6 +178,16 @@ int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
return IMIO_HEADERERROR;
}
if (setjmp (png_jmpbuf(png))) {
png_destroy_read_struct (&png, &info, &end_info);
fclose (file);
return IMIO_READERROR;
}
//set up png read
png_set_read_fn (png, file, png_read_data);
png_set_sig_bytes (png,8);
png_read_info(png,info);
//retrieving image information