diff --git a/png.h b/png.h index 851db0af5..e5693e364 100644 --- a/png.h +++ b/png.h @@ -2008,11 +2008,9 @@ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif -#ifdef PNG_READ_SUPPORTED /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); -#endif #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ diff --git a/pngget.c b/pngget.c index e33afcf2f..f92172385 100644 --- a/pngget.c +++ b/pngget.c @@ -423,7 +423,6 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr, #endif /* PNG_EASY_ACCESS_SUPPORTED */ -#ifdef PNG_READ_SUPPORTED png_byte PNGAPI png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr) { @@ -433,6 +432,7 @@ png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr) return (0); } +#ifdef PNG_READ_SUPPORTED png_const_bytep PNGAPI png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr) { diff --git a/pnginfo.h b/pnginfo.h index 6d196ae69..6bf179531 100644 --- a/pnginfo.h +++ b/pnginfo.h @@ -73,7 +73,10 @@ struct png_info_def png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ png_byte pixel_depth; /* number of bits per pixel */ png_byte spare_byte; /* to align the data, and for future use */ + +#ifdef PNG_READ_SUPPORTED png_byte signature[8]; /* magic bytes read by libpng from start of file */ +#endif /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you