mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-21 16:50:38 +01:00
[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:
parent
c459932482
commit
104c2825ea
1 changed files with 2 additions and 3 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue