summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNullptrderef <nullptrderef@proton.me>2024-01-14 15:18:09 +0100
committerNullptrderef <nullptrderef@proton.me>2024-01-14 15:18:09 +0100
commitac6e97b3f52a323fc6a309d7ae0e9420ff7c670f (patch)
tree98405b3689ef119bf0886c0be59b00d456ceb2c1
parent5c004cf2dcdeff814f6be256294dc1261e21dc74 (diff)
downloadtaler-mdb-ac6e97b3f52a323fc6a309d7ae0e9420ff7c670f.tar.gz
taler-mdb-ac6e97b3f52a323fc6a309d7ae0e9420ff7c670f.tar.bz2
taler-mdb-ac6e97b3f52a323fc6a309d7ae0e9420ff7c670f.zip
initial optimize script, testing
-rw-r--r--contrib/README4
-rwxr-xr-xcontrib/optimize-svgs.sh11
-rw-r--r--contrib/svgo.config.mjs8
3 files changed, 23 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README
index a13a503..216f34c 100644
--- a/contrib/README
+++ b/contrib/README
@@ -3,3 +3,7 @@ Design source files are in `git.taler.net:large-media.git` -> `taler-machine.pen
Each page is exported to `ads/svg/*` and `err/svg/*` respectively, which get converted to pngs using `convert-svgs-to-pngs.sh`.
Please do not edit the SVGs directly; edit them in Penpot and re-export them.
+
+convert-svgs-to-pngs depends on:
+- pngng
+- inkscape (or imagemagick if you set an env var; see script)
diff --git a/contrib/optimize-svgs.sh b/contrib/optimize-svgs.sh
new file mode 100755
index 0000000..6d39500
--- /dev/null
+++ b/contrib/optimize-svgs.sh
@@ -0,0 +1,11 @@
+#!/bin/zsh
+# Calls svgo on all svgs
+
+optimize() {
+ svgo -i $1 -o $1 --config svgo.config.mjs
+}
+
+for svg in ./**/*.svg; do
+ optimize $svg &;
+done;
+wait;
diff --git a/contrib/svgo.config.mjs b/contrib/svgo.config.mjs
new file mode 100644
index 0000000..7a6b177
--- /dev/null
+++ b/contrib/svgo.config.mjs
@@ -0,0 +1,8 @@
+export default {
+ multipass: true, // boolean
+ datauri: 'unenc', // 'base64'|'enc'|'unenc'
+ plugins: [
+ 'preset-default', // built-in plugins enabled by default
+ 'prefixIds', // enable built-in plugins by name
+ ],
+}; \ No newline at end of file