From b3ba443c643946af8a69ccd31c7245b9fa19b53a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 Jan 2010 10:11:31 +0000 Subject: update png handler to not use deprecated/removed call. improve type usage to avoid incompatible pointer type warnings on newer libpng versions. svn path=/trunk/netsurf/; revision=9921 --- image/png.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'image') diff --git a/image/png.c b/image/png.c index c51b89125..4fe7c982a 100644 --- a/image/png.c +++ b/image/png.c @@ -133,7 +133,7 @@ void info_callback(png_structp png, png_infop info) { int bit_depth, color_type, interlace, intent; double gamma; - unsigned long width, height; + png_uint_32 width, height; struct content *c = png_get_progressive_ptr(png); /* Read the PNG details */ @@ -154,7 +154,7 @@ void info_callback(png_structp png, png_infop info) if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) - png_set_gray_1_2_4_to_8(png); + png_set_expand_gray_1_2_4_to_8(png); if (png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); if (bit_depth == 16) @@ -185,8 +185,8 @@ void info_callback(png_structp png, png_infop info) c->width = width; c->height = height; - LOG(("size %li * %li, bpp %i, rowbytes %zu", width, - height, bit_depth, c->data.png.rowbytes)); + LOG(("size %li * %li, bpp %i, rowbytes %zu", (unsigned long)width, + (unsigned long)height, bit_depth, c->data.png.rowbytes)); } -- cgit v1.2.3