avatar.c
changeset 37 62e97e4f562c
parent 36 32424a111e97
child 38 1e64659fe32e
--- 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);