Skip to content

Commit 4adba46

Browse files
authored
Update zune-jpeg to 0.5 (#304)
1 parent 695208c commit 4adba46

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fax34 = { package = "fax", version = "0.2.6", optional = true }
2525
flate2 = { version = "1.0.20", optional = true }
2626
weezl = { version = "0.1.10", optional = true }
2727
zstd = { version = "0.13", optional = true }
28-
zune-jpeg = { version = "0.4.17", optional = true }
28+
zune-jpeg = { version = "0.5.1", optional = true }
2929

3030
[dev-dependencies]
3131
criterion = "0.3.1"

src/decoder/image.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,14 @@ impl Image {
442442
let mut jpeg_data = Vec::new();
443443
jpeg_reader.read_to_end(&mut jpeg_data)?;
444444

445-
let mut decoder = zune_jpeg::JpegDecoder::new(jpeg_data);
445+
let mut decoder =
446+
zune_jpeg::JpegDecoder::new(zune_core::bytestream::ZCursor::new(jpeg_data));
446447
let mut options: zune_core::options::DecoderOptions = Default::default();
447448

448449
// Disable color conversion by setting the output colorspace to the input
449450
// colorspace.
450451
decoder.decode_headers()?;
451-
if let Some(colorspace) = decoder.get_input_colorspace() {
452+
if let Some(colorspace) = decoder.input_colorspace() {
452453
options = options.jpeg_set_out_colorspace(colorspace);
453454
}
454455

0 commit comments

Comments
 (0)