2012/6/7 Josh Glover <jmg...@gmail.com>: > Oops! That was Eclipse changing stuff behind my back. Sorry, I'll redo > the fix without the changes.
Done! git diff 6f2eb55011db7405a261ad148d72c64815bacef4 fdec266c0b432bbec14c2405371bdf671e3bf1d7 -- src/gfx/png_wrapper.cc diff --git a/src/gfx/png_wrapper.cc b/src/gfx/png_wrapper.cc index 9602b43..2389783 100644 --- a/src/gfx/png_wrapper.cc +++ b/src/gfx/png_wrapper.cc @@ -104,8 +104,8 @@ namespace gfx png_read_info(png_ptr, info_ptr); - length = info_ptr->width; - height = info_ptr->height; + length = png_get_image_width(png_ptr, info_ptr); + height = png_get_image_height(png_ptr, info_ptr); number_of_passes = png_set_interlace_handling(png_ptr); png_read_update_info(png_ptr, info_ptr); @@ -118,12 +118,12 @@ namespace gfx return NULL; } - *alpha = (info_ptr->color_type == PNG_COLOR_TYPE_RGBA); + *alpha = (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGBA); const int bytes_per_pixel = (*alpha) ? 4 : 3; char *image = (char *)calloc (length * height, bytes_per_pixel); int idx = 0; - switch (info_ptr->color_type) + switch (png_get_color_type(png_ptr, info_ptr)) { case PNG_COLOR_TYPE_RGBA: { @@ -137,7 +137,7 @@ namespace gfx { row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height); for (int y=0; y<height; y++) - row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes); + row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr)); png_read_image(png_ptr, row_pointers); @@ -156,7 +156,7 @@ namespace gfx break; } default: - LOG(ERROR) << logging::indent() << "[read_png_file] color_type of input file must be PNG_COLOR_TYPE_RGBA (is " << info_ptr->color_type << ")"; + LOG(ERROR) << logging::indent() << "[read_png_file] color_type of input file must be PNG_COLOR_TYPE_RGBA (is " << png_get_color_type(png_ptr, info_ptr) << ")"; png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } @@ -231,7 +231,7 @@ namespace gfx row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height); for (int y=0; y<height; y++) { - row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes); + row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr)); png_byte* row = row_pointers[y]; for (int x=0; x<length; x++) { _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/adonthell-devel