mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #939 from Kelimion/new_png_post_processing
Don't need other path for grayscale output.
This commit is contained in:
@@ -1230,19 +1230,6 @@ load_from_stream :: proc(stream: io.Stream, options := Options{}, allocator := c
|
|||||||
unreachable("We should never see bit depths other than 8, 16 and 'Paletted' here.");
|
unreachable("We should never see bit depths other than 8, 16 and 'Paletted' here.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Rather than first expanding to RGB(A) and then dropping channels, give these their own path.
|
|
||||||
if .do_not_expand_grayscale in options && .Color not_in info.header.color_type {
|
|
||||||
|
|
||||||
single, single_ok := image.return_single_channel(img, .R);
|
|
||||||
if single_ok {
|
|
||||||
destroy(img);
|
|
||||||
img = single;
|
|
||||||
} else {
|
|
||||||
destroy(single);
|
|
||||||
return img, E_PNG.Post_Processing_Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return img, E_General.OK;
|
return img, E_General.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user