From c8774067ee86bb17bf1ac25a100c2d78be79f879 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 20 Oct 2020 12:04:51 +0200 Subject: [PATCH] paperkey: use svg as image format to provide better scalability --- src/bin/proxmox_backup_client/key.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/proxmox_backup_client/key.rs b/src/bin/proxmox_backup_client/key.rs index 2adeb348..8b802b3e 100644 --- a/src/bin/proxmox_backup_client/key.rs +++ b/src/bin/proxmox_backup_client/key.rs @@ -414,13 +414,13 @@ fn paperkey_html(data: &str, subject: Option) -> Result<(), Error> { println!("

"); let data = data.join("\n"); - let qr_code = generate_qr_code("png", data.as_bytes())?; + let qr_code = generate_qr_code("svg", data.as_bytes())?; let qr_code = base64::encode_config(&qr_code, base64::STANDARD_NO_PAD); println!("
"); println!("", qr_code); + println!("src=\"data:image/svg+xml;base64,{}\"/>", qr_code); println!("
"); println!(""); } @@ -447,13 +447,13 @@ fn paperkey_html(data: &str, subject: Option) -> Result<(), Error> { println!("

"); - let qr_code = generate_qr_code("png", key_text.as_bytes())?; + let qr_code = generate_qr_code("svg", key_text.as_bytes())?; let qr_code = base64::encode_config(&qr_code, base64::STANDARD_NO_PAD); println!("
"); println!("", qr_code); + println!("src=\"data:image/svg+xml;base64,{}\"/>", qr_code); println!("
"); println!("");