summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-03 20:43:54 +0100
committerYorhel <git@yorhel.nl>2016-01-10 09:21:29 +0100
commit2a62230db34e26ea8c4182754470252b872131bd (patch)
tree39ad6a707a8d9afa50d63032ba5b9467975f6371 /data
parent3fa146962f64c2a12235ca9fc08b249b2bfc29ac (diff)
Support zopfli/zopflipng for all static asset generators
Compresses a little better. I reduced the number of iterations required to find the optimal image size in spritegen.pl, but generating the icons.png is *incredibly slow* when combining zopflipng with the 'slow' option. It's possible to parallelize the calculation and use multiple cores to speed it up, but that seems overkill. Some icons.png compression stats: METHOD SIZE RUNTIME default 18103 <1sec slow 17941 few secs pngcrush 15385 <1sec pngcrush+slow 15148 few mins zopflipng 14986 few secs zopflipng+slow 14898 ~1 hour
Diffstat (limited to 'data')
-rw-r--r--data/config_example.pl9
-rw-r--r--data/global.pl8
2 files changed, 14 insertions, 3 deletions
diff --git a/data/config_example.pl b/data/config_example.pl
index 96f003fc..ce272637 100644
--- a/data/config_example.pl
+++ b/data/config_example.pl
@@ -40,6 +40,11 @@ package VNDB;
#$JSGEN{compress} = 'JavaScript::Minifier::XS';
#$JSGEN{compress} = "|/usr/bin/uglifyjs --compress --mangle";
-# Uncomment to generate an extra small icons.png (note: setting both pngcrush and slow options really is slow)
-#$SPRITEGEN{pngcrush} = '/usr/bin/pngcrush';
+# Uncomment to create pre-compressed css and js files using zopfli
+#$JSGEN{gzip} = $SKINGEN{gzip} = "/usr/bin/zopfli";
+
+# Uncomment to generate an extra small icons.png
+# (note: using zopflipng or pngcrush with the slow option is *really* slow, but compresses awesomely)
+#$SPRITEGEN{crush} = '/usr/bin/pngcrush -q';
+#$SPRITEGEN{crush} = '/usr/bin/zopflipng -m --lossy_transparent';
#$SPRITEGEN{slow} = 1;
diff --git a/data/global.pl b/data/global.pl
index 29f1a6c9..ca1df4d3 100644
--- a/data/global.pl
+++ b/data/global.pl
@@ -137,13 +137,19 @@ our %M = (
# Options for jsgen.pl
our %JSGEN = (
compress => undef,
+ gzip => undef,
);
# Options for spritegen.pl
our %SPRITEGEN = (
slow => 0,
- pngcrush => undef,
+ crush => undef,
+);
+
+# Options for skingen.pl
+our %SKINGEN = (
+ gzip => undef,
);