[cairo-png] Set bKGD gray value.

For PNG_COLOR_TYPE_GRAY images the bKGD value is read from white.gray
which was uninitialized, triggering the "PNG warning = Ignoring attempt
to write bKGD chunk out-of-range for bit_depth" reported by Emmanuel
Pacaud. This patch sets the background gray value to white, the same as
for RGB images.
This commit is contained in:
Chris Wilson 2008-03-21 09:11:48 +00:00
parent c459932482
commit 104c2825ea

View file

@ -211,9 +211,8 @@ write_png (cairo_surface_t *surface,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
white.red = 0xff;
white.blue = 0xff;
white.green = 0xff;
white.gray = (1 << depth) - 1;
white.red = white.blue = white.green = white.gray;
png_set_bKGD (png, info, &white);
png_convert_from_time_t (&pt, time (NULL));