Update zune-jpeg to 0.5 (#304)
This commit is contained in:
1 parent
695208cffe
commit
4adba46b9f
2 files changed
+4
-3
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ fax34 = { package = "fax", version = "0.2.6", optional = true }
|
|||||||
flate2 = { version = "1.0.20", optional = true }
|
flate2 = { version = "1.0.20", optional = true }
|
||||||
weezl = { version = "0.1.10", optional = true }
|
weezl = { version = "0.1.10", optional = true }
|
||||||
zstd = { version = "0.13", optional = true }
|
zstd = { version = "0.13", optional = true }
|
||||||
zune-jpeg = { version = "0.4.17", optional = true }
|
zune-jpeg = { version = "0.5.1", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = "0.3.1"
|
criterion = "0.3.1"
|
||||||
|
|||||||
@@ -442,13 +442,14 @@ impl Image {
|
|||||||
let mut jpeg_data = Vec::new();
|
let mut jpeg_data = Vec::new();
|
||||||
jpeg_reader.read_to_end(&mut jpeg_data)?;
|
jpeg_reader.read_to_end(&mut jpeg_data)?;
|
||||||
|
|
||||||
let mut decoder = zune_jpeg::JpegDecoder::new(jpeg_data);
|
let mut decoder =
|
||||||
|
zune_jpeg::JpegDecoder::new(zune_core::bytestream::ZCursor::new(jpeg_data));
|
||||||
let mut options: zune_core::options::DecoderOptions = Default::default();
|
let mut options: zune_core::options::DecoderOptions = Default::default();
|
||||||
|
|
||||||
// Disable color conversion by setting the output colorspace to the input
|
// Disable color conversion by setting the output colorspace to the input
|
||||||
// colorspace.
|
// colorspace.
|
||||||
decoder.decode_headers()?;
|
decoder.decode_headers()?;
|
||||||
if let Some(colorspace) = decoder.get_input_colorspace() {
|
if let Some(colorspace) = decoder.input_colorspace() {
|
||||||
options = options.jpeg_set_out_colorspace(colorspace);
|
options = options.jpeg_set_out_colorspace(colorspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user