Added filter and removed appending .png to file location string
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user