[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] 01/03: initial optimize script, testing
From: |
gnunet |
Subject: |
[taler-taler-mdb] 01/03: initial optimize script, testing |
Date: |
Sun, 14 Jan 2024 15:22:19 +0100 |
This is an automated email from the git hooks/post-receive script.
nora pushed a commit to branch master
in repository taler-mdb.
commit ac6e97b3f52a323fc6a309d7ae0e9420ff7c670f
Author: Nullptrderef <nullptrderef@proton.me>
AuthorDate: Sun Jan 14 15:18:09 2024 +0100
initial optimize script, testing
---
contrib/README | 4 ++++
contrib/optimize-svgs.sh | 11 +++++++++++
contrib/svgo.config.mjs | 8 ++++++++
3 files changed, 23 insertions(+)
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
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.