Added filter and removed appending .png to file location string

This commit is contained in:
brotoskyj
2025-01-17 17:10:27 -05:00
parent fddae03849
commit 6a30f76c17
+1 -1
View File
@@ -18,13 +18,13 @@ fn main() {
let websitetext = binding.as_str();
let result = FileDialog::new()
.set_location("~/Downloads")
.add_filter("Image", &["png", "jpg", "gif"])
.show_save_single_file()
.expect("Unknown File Path")
.unwrap();
let mut savelocation = result.into_os_string().into_string().unwrap();
let qrcode = QrCode::new(websitetext.as_bytes()).unwrap();
let image = qrcode.render::<Luma<u8>>().build();
savelocation.push_str(".png");
image.save(savelocation);
}
});