We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23dd5ab commit d038c60Copy full SHA for d038c60
crates/resvg/src/image.rs
@@ -94,7 +94,10 @@ mod raster_images {
94
let data = decoder.decode().ok()?;
95
match output_cs {
96
ColorSpace::RGBA => data,
97
- // For some reason zune jpeg won't coerce luma JPEGs into RGBA, so we do it manually.
+ // `set_output_color_space` is not guaranteed to actually always set the output space
98
+ // to RGBA (see https://docs.rs/zune-core/latest/zune_core/options/struct.DecoderOptions.html#method.jpeg_set_out_colorspace).
99
+ // In particular, it seems like it doesn't work for luma JPEGs,
100
+ // so we convert them manually.
101
ColorSpace::Luma => data
102
.into_iter()
103
.flat_map(|p| [p, p, p, 255])
0 commit comments