mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
PNG: Fix test for when premultiplication is needed.
This commit is contained in:
@@ -731,7 +731,7 @@ load_from_stream :: proc(stream: io.Stream, options := Options{}, allocator := c
|
|||||||
`.blend_background` and `seen_bkgd` if we haven't seen both.
|
`.blend_background` and `seen_bkgd` if we haven't seen both.
|
||||||
*/
|
*/
|
||||||
if !(seen_bkgd && .blend_background in options) {
|
if !(seen_bkgd && .blend_background in options) {
|
||||||
options ~= {.blend_background};
|
options -= {.blend_background};
|
||||||
seen_bkgd = false;
|
seen_bkgd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,7 +748,7 @@ load_from_stream :: proc(stream: io.Stream, options := Options{}, allocator := c
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_alpha := (seen_trns && .alpha_drop_if_present not_in options) || (.alpha_add_if_missing in options);
|
add_alpha := (seen_trns && .alpha_drop_if_present not_in options) || (.alpha_add_if_missing in options);
|
||||||
premultiply := .alpha_premultiply in options || .blend_background in options;
|
premultiply := .alpha_premultiply in options || seen_bkgd;
|
||||||
|
|
||||||
img.channels = out_image_channels;
|
img.channels = out_image_channels;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user