Skip to content

Commit

Permalink
merged scribblemaniac
Browse files Browse the repository at this point in the history
  • Loading branch information
electronstudio committed Jul 31, 2024
2 parents 4350e7a + dec0909 commit d91c6bc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/gui.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::cmp::min;
use std::iter::Iterator;
use std::net::{IpAddr, SocketAddr};

Expand Down Expand Up @@ -305,11 +306,8 @@ pub fn run(config: &Config, log_receiver: mpsc::Receiver<String>) {
let code = QrCode::new(&url_string).unwrap();
let img_buf = code.render::<Luma<u8>>().build();
let image = image::DynamicImage::ImageLuma8(img_buf);
let image = image.resize_exact(
qr_frame.width() as u32,
qr_frame.height() as u32,
image::imageops::FilterType::Nearest,
);
let dims = min(qr_frame.width(), qr_frame.height()) as u32;
let image = image.resize_exact(dims, dims, image::imageops::FilterType::Nearest);
let mut buf = vec![];
image
.write_to(&mut buf, image::ImageOutputFormat::Png)
Expand Down

0 comments on commit d91c6bc

Please sign in to comment.