Skip to content

Commit 9a46fe4

Browse files
committed
Update png dependency
1 parent 79838d4 commit 9a46fe4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ byteorder = "1.0"
1515
rayon = { version = "1.0", optional = true }
1616

1717
[dev-dependencies]
18-
png = "0.14"
18+
png = "0.15"
1919
walkdir = "2.0"
2020
criterion = "0.3"
2121

examples/decode.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ fn main() {
2424

2525
let output_file = File::create(output_path).unwrap();
2626
let mut encoder = png::Encoder::new(output_file, info.width as u32, info.height as u32);
27-
encoder.set(png::BitDepth::Eight);
27+
encoder.set_depth(png::BitDepth::Eight);
2828

2929
match info.pixel_format {
30-
jpeg::PixelFormat::L8 => encoder.set(png::ColorType::Grayscale),
31-
jpeg::PixelFormat::RGB24 => encoder.set(png::ColorType::RGB),
30+
jpeg::PixelFormat::L8 => encoder.set_color(png::ColorType::Grayscale),
31+
jpeg::PixelFormat::RGB24 => encoder.set_color(png::ColorType::RGB),
3232
jpeg::PixelFormat::CMYK32 => {
3333
data = cmyk_to_rgb(&mut data);
34-
encoder.set(png::ColorType::RGB)
34+
encoder.set_color(png::ColorType::RGB)
3535
},
3636
};
3737

tests/reftest/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use jpeg;
2-
use png::{self, HasParameters};
2+
use png;
33
use std::cmp;
44
use std::fs::File;
55
use std::path::Path;
@@ -94,8 +94,8 @@ fn reftest_decoder<T: std::io::Read>(mut decoder: jpeg::Decoder<T>, path: &Path,
9494
let output_path = path.with_file_name(format!("{}-diff.png", path.file_stem().unwrap().to_str().unwrap()));
9595
let output = File::create(&output_path).unwrap();
9696
let mut encoder = png::Encoder::new(output, info.width as u32, info.height as u32);
97-
encoder.set(png::BitDepth::Eight);
98-
encoder.set(ref_pixel_format);
97+
encoder.set_depth(png::BitDepth::Eight);
98+
encoder.set_color(ref_pixel_format);
9999
encoder.write_header().expect("png failed to write header").write_image_data(&pixels).expect("png failed to write data");
100100

101101
panic!("decoding difference: {:?}, maximum difference was {}", output_path, max_diff);

0 commit comments

Comments
 (0)