can not read png file with libpng
问题 I am new to libpng and the documentation is really confusing for me. Below is my code which is not working and I do not see the reason why. Can someone point me to right direction? or suggest different ( "easier" ) library? how I understand libpng: open the file with fopen in rb mode create png_structp with png_create_read_struct create png_infop with png_create_info_struct allocate space read data #include <stdio.h> #include <png.h> int main( int argc, char **argv ) { int x, y; int height,