From: Ian Jackson Date: Sat, 22 May 2021 19:30:06 +0000 (+0100) Subject: bundles: Allow differing source file name X-Git-Tag: otter-0.6.0~63 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0194acee3102475ef397fba9b3b63db089b2db83;p=otter.git bundles: Allow differing source file name Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 29a84f9d..1cd16266 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -756,10 +756,10 @@ fn image_usvg(zfname: &str, input: File, output: File, fn make_usvg(za: &mut IndexedZip, progress_count: &mut usize, mut for_progress: &mut dyn progress::Originator, dir_inzip: &str, svg_dir: &str, - item: &GoodItemName, _src_name: &str) { + item: &GoodItemName, src_name: &str) { let (format, mut zf) = 'format: loop { for format in PictureFormat::iter() { - let input_basename = format!("{}/{}.{}", dir_inzip, item, format); + let input_basename = format!("{}/{}.{}", dir_inzip, src_name, format); if let Some(zf) = za.by_name_caseless(input_basename)? { break 'format (format, zf); } diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 58a4b255..d28c3946 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -237,7 +237,9 @@ pub struct FileData { /// The core of the remote file name, for pieces which are scraped. /// - /// Not used by Otter during runtime or when loading pieces. + /// In bundles, is the source file name if it isn't `-`. + /// In builtin libs, + /// not used by Otter during runtime or when loading. /// /// When [`scraper.method`](LibraryTomlFile::scraper) is `"none"`, /// this field is not used and is conventionally set to "`-`".