[librsvg/rustify-rsvg-convert: 17/41] rsvg_convert: fix empty_svg_yields_error test case




commit 402a8d03798f43b0a926036396b731a4578f1013
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Jan 8 16:52:54 2021 +0100

    rsvg_convert: fix empty_svg_yields_error test case

 src/bin/rsvg-convert/main.rs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/bin/rsvg-convert/main.rs b/src/bin/rsvg-convert/main.rs
index 2f2e8b61..837050ef 100644
--- a/src/bin/rsvg-convert/main.rs
+++ b/src/bin/rsvg-convert/main.rs
@@ -77,6 +77,10 @@ fn main() {
             let size = get_size(&handle, &renderer, &args)
                 .unwrap_or_else(|e| exit!("Error rendering SVG {}: {}", input, e));
 
+            if size.w == 0.0 && size.h == 0.0 {
+                exit!("The SVG {} has no dimensions", input);
+            }
+
             target = {
                 let output = Stream::new(args.output())
                     .unwrap_or_else(|e| exit!("Error opening output: {}", e));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]