mirror of https://github.com/tauri-apps/tauri
chore(deps) Update Rust crate png to 0.17 (#3652)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
parent
66c52f0ac8
commit
cf53761718
|
@ -31,7 +31,7 @@ uuid = { version = "0.8", features = [ "v4" ] }
|
||||||
ico = "0.1"
|
ico = "0.1"
|
||||||
|
|
||||||
[target."cfg(target_os = \"linux\")".dependencies]
|
[target."cfg(target_os = \"linux\")".dependencies]
|
||||||
png = "0.16"
|
png = "0.17"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "compression" ]
|
default = [ "compression" ]
|
||||||
|
|
|
@ -410,15 +410,15 @@ fn png_icon<P: AsRef<Path>>(
|
||||||
.unwrap_or_else(|_| panic!("failed to read window icon {}", path.display()))
|
.unwrap_or_else(|_| panic!("failed to read window icon {}", path.display()))
|
||||||
.to_vec();
|
.to_vec();
|
||||||
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
|
let mut reader = decoder
|
||||||
.read_info()
|
.read_info()
|
||||||
.unwrap_or_else(|_| panic!("failed to read window icon {}", path.display()));
|
.unwrap_or_else(|_| panic!("failed to read window icon {}", path.display()));
|
||||||
let mut buffer: Vec<u8> = Vec::new();
|
let mut buffer: Vec<u8> = 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());
|
||||||
}
|
}
|
||||||
let width = info.width;
|
let width = reader.info().width;
|
||||||
let height = info.height;
|
let height = reader.info().height;
|
||||||
|
|
||||||
let out_path = out_dir.join(path.file_name().unwrap());
|
let out_path = out_dir.join(path.file_name().unwrap());
|
||||||
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
let mut out_file = File::create(&out_path).map_err(|error| EmbeddedAssetsError::AssetWrite {
|
||||||
|
|
Loading…
Reference in New Issue