summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-03-07 17:12:41 +0100
committerBastien Nocera <hadess@hadess.net>2019-03-12 13:19:51 +0100
commit6bd02280b0d107414493249a94bfa0603c4a90c8 (patch)
treedde32a53cefa9c02d1af1ae0374c5ab3d605c427
parent9cd78330418ca1064e85d3cedf876869d387e790 (diff)
downloadflatpak-wip/hadess/allow-huge-svg.tar.gz
icon-validator: Don't check SVG sizewip/hadess/allow-huge-svg
The size is just a number, but the resulting GdkPixbuf could still be quite big compared to the amount of data we're processing, so keep 4096x4096 as maximum dimensions.
-rw-r--r--icon-validator/validate-icon.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/icon-validator/validate-icon.c b/icon-validator/validate-icon.c
index 4e99b34d..af1c8208 100644
--- a/icon-validator/validate-icon.c
+++ b/icon-validator/validate-icon.c
@@ -49,18 +49,26 @@ validate_icon (const char *arg_width,
return 1;
}
- max_width = g_ascii_strtoll (arg_width, NULL, 10);
- if (max_width < 16 || max_width > 4096)
+ if (!g_str_equal (name, "svg"))
{
- g_printerr ("Bad width limit: %s\n", arg_width);
- return 1;
- }
+ max_width = g_ascii_strtoll (arg_width, NULL, 10);
+ if (max_width < 16 || max_width > 4096)
+ {
+ g_printerr ("Bad width limit: %s\n", arg_width);
+ return 1;
+ }
- max_height = g_ascii_strtoll (arg_height, NULL, 10);
- if (max_height < 16 || max_height > 4096)
+ max_height = g_ascii_strtoll (arg_height, NULL, 10);
+ if (max_height < 16 || max_height > 4096)
+ {
+ g_printerr ("Bad height limit: %s\n", arg_height);
+ return 1;
+ }
+ }
+ else
{
- g_printerr ("Bad height limit: %s\n", arg_height);
- return 1;
+ /* Sanity check for vector files */
+ max_height = max_width = 4096;
}
if (width > max_width || height > max_height)