From 601d1c576aa3287785f5c09098ea15836574e831 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 8 Oct 2024 20:39:52 +0200 Subject: generate spiseseddel3 PDF and JPEG from SVG --- .gitignore | 2 ++ _quarto.yml | 3 ++- bin/svg+pdf+jpg.sh | 13 +++++++++++++ tryk/spiseseddel3.jpg | Bin 916027 -> 0 bytes tryk/spiseseddel3.pdf | Bin 401359 -> 0 bytes 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 bin/svg+pdf+jpg.sh delete mode 100644 tryk/spiseseddel3.jpg delete mode 100644 tryk/spiseseddel3.pdf diff --git a/.gitignore b/.gitignore index 47c274c..ac3afc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /.quarto/ /_site/ +/tryk/spiseseddel3.pdf +/tryk/spiseseddel3.jpg diff --git a/_quarto.yml b/_quarto.yml index d1cd6b3..828838d 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -1,8 +1,9 @@ project: type: website + pre-render: + - bin/svg+pdf+jpg.sh tryk/spiseseddel3.svg post-render: - bin/pdfcompress.sh _site/tryk/oroeposten_3.pdf -# - bin/pdfcompress.sh _site/tryk/spiseseddel3.pdf website: title: Orøposten 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" diff --git a/tryk/spiseseddel3.jpg b/tryk/spiseseddel3.jpg deleted file mode 100644 index 754b6a5..0000000 Binary files a/tryk/spiseseddel3.jpg and /dev/null differ diff --git a/tryk/spiseseddel3.pdf b/tryk/spiseseddel3.pdf deleted file mode 100644 index a588f24..0000000 Binary files a/tryk/spiseseddel3.pdf and /dev/null differ -- cgit v1.2.3