Update png to 0.18

This commit is contained in:
Héctor Ramón Jiménez 2025-09-08 05:40:31 +02:00
parent cb9b106ff8
commit 354159bdf4
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 9 additions and 6 deletions

6
Cargo.lock generated
View file

@ -2446,7 +2446,7 @@ version = "0.14.0-dev"
dependencies = [
"iced_renderer",
"iced_runtime",
"png 0.17.16",
"png 0.18.0",
"sha2",
"thiserror 1.0.69",
]
@ -4907,9 +4907,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
version = "2.14.0"
version = "2.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
dependencies = [
"core-foundation-sys",
"libc",

View file

@ -187,7 +187,7 @@ lyon = "1.0"
lyon_path = "1.0"
num-traits = "0.2"
ouroboros = "0.18"
png = "0.17"
png = "0.18"
pulldown-cmark = "0.12"
qrcode = { version = "0.13", default-features = false }
raw-window-handle = "0.6"

View file

@ -494,10 +494,13 @@ impl Snapshot {
if path.exists() {
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 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)?;
Ok(self.screenshot.bytes == bytes[..info.buffer_size()])