From a1ebd253fc660e8479435eccd819769c308a8872 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 22 May 2021 22:27:54 +0100 Subject: [PATCH] bundles: Move BufReader back into image_usvg It's base64_usvg that the actual-svg will want. Signed-off-by: Ian Jackson --- src/bundles.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bundles.rs b/src/bundles.rs index 9c142899..52b2f5be 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -724,8 +724,10 @@ struct Base64Meta { } #[throws(LE)] -fn image_usvg(zfname: &str, mut input: BufReader, output: File, +fn image_usvg(zfname: &str, input: File, output: File, format: image::ImageFormat, ctype: &'static str) { + let mut input = BufReader::new(input); + let image = image::io::Reader::with_format(&mut input, format); let (width, height) = image.into_dimensions().map_err( |e| LE::BadBundle(format!("{}: image examination failed: {}", @@ -856,7 +858,6 @@ fn make_usvg(za: &mut IndexedZip, progress_count: &mut usize, dbgc!(size); }, PF::Png => { - let input = BufReader::new(input); image_usvg(zf.name(),input,output, IF::Png, "image/png")?; }, } -- 2.30.2