mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-17 15:04:18 +03:00
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
This commit is contained in:
parent
8e1b4a0061
commit
b3ba443c64
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user