# HG changeset patch # User Myhailo Danylenko # Date 1336600200 -10800 # Node ID 62e97e4f562c93eb1866a81fecaa003ad62ed921 # Parent 32424a111e97539d4164c9840f50b06307b5cb5f Fix compatibility with libpng 1.5 Use accessors for fields in info struct diff -r 32424a111e97 -r 62e97e4f562c avatar.c --- a/avatar.c Thu Jun 30 16:09:04 2011 +0300 +++ b/avatar.c Thu May 10 00:50:00 2012 +0300 @@ -185,8 +185,8 @@ png_read_info (png_ptr, info_ptr); { // set up transformations - png_byte color_type = info_ptr->color_type; - png_byte bit_depth = info_ptr->bit_depth; + png_byte color_type = png_get_color_type ( png_ptr, info_ptr ); + png_byte bit_depth = png_get_bit_depth ( png_ptr, info_ptr ); // trying to convert anything to grayscale 8-bit without alpha channel if (color_type == PNG_COLOR_TYPE_PALETTE) @@ -213,9 +213,9 @@ png_read_update_info (png_ptr, info_ptr); } - width = info_ptr->width; - height = info_ptr->height; - rowbytes = info_ptr->rowbytes; + width = png_get_image_width ( png_ptr, info_ptr ); + height = png_get_image_height ( png_ptr, info_ptr ); + rowbytes = png_get_rowbytes ( png_ptr, info_ptr ); { // allocate buffer for image data png_bytep chunk = g_malloc ((sizeof(png_bytep) + rowbytes) * height);