summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-10-08 20:39:52 +0200
committerJonas Smedegaard <dr@jones.dk>2024-10-08 20:39:52 +0200
commit601d1c576aa3287785f5c09098ea15836574e831 (patch)
treeadb6b56c931b7cdd822cb4ada163ddce005d9ef5 /bin
parentddcbdd5ec3eb29a99dd8bb95ee369297d507c7cd (diff)
generate spiseseddel3 PDF and JPEG from SVG
Diffstat (limited to 'bin')
-rwxr-xr-xbin/svg+pdf+jpg.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/svg+pdf+jpg.sh b/bin/svg+pdf+jpg.sh
new file mode 100755
index 0000000..9d6edc4
--- /dev/null
+++ b/bin/svg+pdf+jpg.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -eu
+
+INFILE=$1
+DIR=$(dirname "$INFILE")
+STEM=$(basename "$INFILE" .svg)
+
+[ -n "$QUARTO_PROJECT_RENDER_ALL" ] || exit
+
+inkscape --export-type=pdf,png --export-width=1800 "$INFILE"
+ffmpeg -hide_banner -loglevel warning -y -i "$DIR/$STEM.png" -update 1 -frames:v 1 "$DIR/$STEM.jpg"
+rm "$DIR/$STEM.png"