Update png to 0.18
This commit is contained in:
parent
cb9b106ff8
commit
354159bdf4
3 changed files with 9 additions and 6 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
|
@ -2446,7 +2446,7 @@ version = "0.14.0-dev"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
"png 0.17.16",
|
"png 0.18.0",
|
||||||
"sha2",
|
"sha2",
|
||||||
"thiserror 1.0.69",
|
"thiserror 1.0.69",
|
||||||
]
|
]
|
||||||
|
|
@ -4907,9 +4907,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "security-framework-sys"
|
name = "security-framework-sys"
|
||||||
version = "2.14.0"
|
version = "2.15.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
|
checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc",
|
"libc",
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ lyon = "1.0"
|
||||||
lyon_path = "1.0"
|
lyon_path = "1.0"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
ouroboros = "0.18"
|
ouroboros = "0.18"
|
||||||
png = "0.17"
|
png = "0.18"
|
||||||
pulldown-cmark = "0.12"
|
pulldown-cmark = "0.12"
|
||||||
qrcode = { version = "0.13", default-features = false }
|
qrcode = { version = "0.13", default-features = false }
|
||||||
raw-window-handle = "0.6"
|
raw-window-handle = "0.6"
|
||||||
|
|
|
||||||
|
|
@ -494,10 +494,13 @@ impl Snapshot {
|
||||||
|
|
||||||
if path.exists() {
|
if path.exists() {
|
||||||
let file = fs::File::open(&path)?;
|
let file = fs::File::open(&path)?;
|
||||||
let decoder = png::Decoder::new(file);
|
let decoder = png::Decoder::new(io::BufReader::new(file));
|
||||||
|
|
||||||
let mut reader = decoder.read_info()?;
|
let mut reader = decoder.read_info()?;
|
||||||
let mut bytes = vec![0; reader.output_buffer_size()];
|
let n = reader
|
||||||
|
.output_buffer_size()
|
||||||
|
.expect("snapshot should fit in memory");
|
||||||
|
let mut bytes = vec![0; n];
|
||||||
let info = reader.next_frame(&mut bytes)?;
|
let info = reader.next_frame(&mut bytes)?;
|
||||||
|
|
||||||
Ok(self.screenshot.bytes == bytes[..info.buffer_size()])
|
Ok(self.screenshot.bytes == bytes[..info.buffer_size()])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue