From 1b9565fa2eeb2635f2233161f920963bf514b524 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 4 Dec 2021 18:55:49 +0100 Subject: Use img srcset for cover images of differing resolutions. --- tools/gencovers.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/gencovers.sh (limited to 'tools') diff --git a/tools/gencovers.sh b/tools/gencovers.sh new file mode 100644 index 0000000..911a050 --- /dev/null +++ b/tools/gencovers.sh @@ -0,0 +1,13 @@ +for F in public/*/cover.jpg +do + echo Processing: $F + B=$(echo $F | sed s/.jpg//) + + convert -scale 200x200 $F $B.1x.png + mozjpeg -q 95 -outfile $B.1x.jpg $B.1x.png + rm -f $B.1x.png + + convert -scale 400x400 $F $B.2x.png + mozjpeg -q 90 -outfile $B.2x.jpg $B.2x.png + rm -f $B.2x.png +done -- cgit v1.2.3