Skip to content

Commit d038c60

Browse files
committed
Add a link to zune-jpeg docs
1 parent 23dd5ab commit d038c60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/resvg/src/image.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ mod raster_images {
9494
let data = decoder.decode().ok()?;
9595
match output_cs {
9696
ColorSpace::RGBA => data,
97-
// For some reason zune jpeg won't coerce luma JPEGs into RGBA, so we do it manually.
97+
// `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.
98101
ColorSpace::Luma => data
99102
.into_iter()
100103
.flat_map(|p| [p, p, p, 255])

0 commit comments

Comments
 (0)