chore(deps): update Rust crate png to 0.17

This commit is contained in:
Lucas Nogueira 2022-03-22 15:07:41 -03:00
parent d112f2005a
commit 3d11ac656c
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1
2 changed files with 5 additions and 5 deletions

View File

@ -90,7 +90,7 @@ glob = "0.3"
data-url = { version = "0.1", optional = true } data-url = { version = "0.1", optional = true }
serialize-to-javascript = "=0.1.1" serialize-to-javascript = "=0.1.1"
infer = { version = "0.7", optional = true } infer = { version = "0.7", optional = true }
png = { version = "0.16", optional = true } png = { version = "0.17", optional = true }
ico = { version = "0.1", optional = true } ico = { version = "0.1", optional = true }
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]

View File

@ -389,15 +389,15 @@ impl TryFrom<Icon> for runtime::WindowIcon {
#[cfg(feature = "icon-png")] #[cfg(feature = "icon-png")]
"png" => { "png" => {
let decoder = png::Decoder::new(std::io::Cursor::new(bytes)); let decoder = png::Decoder::new(std::io::Cursor::new(bytes));
let (info, mut reader) = decoder.read_info()?; let mut reader = decoder.read_info()?;
let mut buffer = Vec::new(); let mut buffer = Vec::new();
while let Ok(Some(row)) = reader.next_row() { while let Ok(Some(row)) = reader.next_row() {
buffer.extend(row); buffer.extend(row.data());
} }
Ok(Self { Ok(Self {
rgba: buffer, rgba: buffer,
width: info.width, width: reader.info().width,
height: info.height, height: reader.info().height,
}) })
} }
_ => panic!( _ => panic!(