chore: comment out image generator when not in use

This commit is contained in:
Jonathan Kelley committed 2022-02-13 12:35:07 -05:00
1 parent 64f8e58c04
commit ab99bc6c8d
2 files changed
+26 -23

No files matched your search

+1 -1
View File
@@ -41,4 +41,4 @@ tokio_runtime = ["tokio"]
[dev-dependencies] [dev-dependencies]
dioxus-hooks = { path = "../hooks" } dioxus-hooks = { path = "../hooks" }
image = "0.24.0" # image = "0.24.0" # enable this when generating a new desktop image
+25 -22
View File
@@ -103,25 +103,28 @@ impl Default for DesktopConfig {
// dirty trick, avoid introducing `image` at runtime // dirty trick, avoid introducing `image` at runtime
// TODO: use serde when `Icon` impl serde // TODO: use serde when `Icon` impl serde
#[test] //
#[ignore] // This function should only be enabled when generating new icons.
fn prepare_default_icon() { //
use image::io::Reader as ImageReader; // #[test]
use image::ImageFormat; // #[ignore]
use std::fs::File; // fn prepare_default_icon() {
use std::io::Cursor; // use image::io::Reader as ImageReader;
use std::io::Write; // use image::ImageFormat;
use std::path::PathBuf; // use std::fs::File;
let png: &[u8] = include_bytes!("default_icon.png"); // use std::io::Cursor;
let mut reader = ImageReader::new(Cursor::new(png)); // use std::io::Write;
reader.set_format(ImageFormat::Png); // use std::path::PathBuf;
let icon = reader.decode().unwrap(); // let png: &[u8] = include_bytes!("default_icon.png");
let bin = PathBuf::from(file!()) // let mut reader = ImageReader::new(Cursor::new(png));
.parent() // reader.set_format(ImageFormat::Png);
.unwrap() // let icon = reader.decode().unwrap();
.join("default_icon.bin"); // let bin = PathBuf::from(file!())
println!("{:?}", bin); // .parent()
let mut file = File::create(bin).unwrap(); // .unwrap()
file.write_all(icon.as_bytes()).unwrap(); // .join("default_icon.bin");
println!("({}, {})", icon.width(), icon.height()) // println!("{:?}", bin);
} // let mut file = File::create(bin).unwrap();
// file.write_all(icon.as_bytes()).unwrap();
// println!("({}, {})", icon.width(), icon.height())
// }