Don't need other path for grayscale output.

This commit is contained in:
Jeroen van Rijn
2021-05-02 21:11:06 +02:00
parent 7d534769d6
commit 3160a6a12c

View File

@@ -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.");
}
// 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;
}