diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-12-04 18:55:49 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-12-04 18:57:24 +0100 |
commit | 1b9565fa2eeb2635f2233161f920963bf514b524 (patch) | |
tree | 63b1623f9575c8453d5348a9d9eeaa54e34e472d /tools/gencovers.sh | |
parent | 07c8263929fb5b46082d5c3b20a11edfb59a2b25 (diff) | |
download | server-1b9565fa2eeb2635f2233161f920963bf514b524.tar.gz |
Use img srcset for cover images of differing resolutions.
Diffstat (limited to 'tools/gencovers.sh')
-rw-r--r-- | tools/gencovers.sh | 13 |
1 files changed, 13 insertions, 0 deletions
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 |