Skip to content

Commit

Permalink
Fix base64
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed May 8, 2024
1 parent b1d06ca commit 496c0fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/font2svg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::io::Write;
use std::path::PathBuf;
use base64::engine::general_purpose::STANDARD;

use ttf_parser as ttf;
use ttf_parser::colr::{ClipBox, Paint};
Expand Down Expand Up @@ -174,7 +175,7 @@ fn process(args: Args) -> Result<(), Box<dyn std::error::Error>> {
svg.write_attribute_raw("xlink:href", |buf| {
buf.extend_from_slice(b"data:image/png;base64, ");

let mut enc = base64::write::EncoderWriter::new(buf, base64::STANDARD);
let mut enc = base64::write::EncoderWriter::new(buf, &STANDARD);
enc.write_all(img.data).unwrap();
enc.finish().unwrap();
});
Expand All @@ -188,7 +189,7 @@ fn process(args: Args) -> Result<(), Box<dyn std::error::Error>> {
svg.write_attribute_raw("xlink:href", |buf| {
buf.extend_from_slice(b"data:image/svg+xml;base64, ");

let mut enc = base64::write::EncoderWriter::new(buf, base64::STANDARD);
let mut enc = base64::write::EncoderWriter::new(buf, &STANDARD);
enc.write_all(img.data).unwrap();
enc.finish().unwrap();
});
Expand Down

0 comments on commit 496c0fb

Please sign in to comment.