Skip to content

Commit

Permalink
update qrcode
Browse files Browse the repository at this point in the history
  • Loading branch information
robatipoor committed Mar 14, 2024
1 parent 018a1eb commit 3a11a1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ indicatif = "0.17.8"
log = "0.4.21"
mime_guess = "2.0.4"
once_cell = { version = "1.19.0" }
qrcode = "0.13"
image = "0.24.9"
qrcode = "0.14.0"
image = "0.25.0"
rand = "0.8.5"
reqwest = { version = "0.11.25", default-features = false, features = [
"json",
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/util/qr_code.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::io::Cursor;

use base64::{engine::general_purpose::STANDARD, Engine};
use image::{ImageOutputFormat, Luma};
use image::{ImageFormat, Luma};
use qrcode::QrCode;

pub fn generate_text_qr_code(input: &str) -> anyhow::Result<String> {
Expand All @@ -25,7 +25,7 @@ pub fn generate_base64_png_qr_code(input: &str) -> anyhow::Result<String> {
.module_dimensions(20, 20)
.build();
let mut buff = Cursor::new(Vec::new());
qr_code.write_to(&mut buff, ImageOutputFormat::Png)?;
qr_code.write_to(&mut buff, ImageFormat::Png)?;
Ok(STANDARD.encode(buff.into_inner()))
}

Expand Down

0 comments on commit 3a11a1a

Please sign in to comment.