+ png_read_info(png_ptr, info_ptr);
+
+ int bit_depth,color_type,interlace_type, compression_type,filter_method;
+ png_uint_32 width,height;
+
+ png_get_IHDR(png_ptr, info_ptr, &width, &height,
+ &bit_depth, &color_type, &interlace_type,
+ &compression_type, &filter_method);
+
+ if (bit_depth == 16)
+ png_set_strip_16(png_ptr);
+
+ if (bit_depth < 8)
+ png_set_packing(png_ptr);
+