diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-08-07 22:46:47 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-20 12:24:34 +0200 |
commit | 640d8ab01b6763db2d120271230bc261b3cca2ec (patch) | |
tree | a01159763654124a01c2431a9f47f98921fbbde5 /tools | |
parent | 13c1fa8e54b8a02854a0b15a19d54e0efa4968d6 (diff) | |
download | server-640d8ab01b6763db2d120271230bc261b3cca2ec.tar.gz |
Use smaller cover images for front page.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gencovers.sh | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/gencovers.sh b/tools/gencovers.sh index 5d4d244..454d69b 100644 --- a/tools/gencovers.sh +++ b/tools/gencovers.sh @@ -4,7 +4,7 @@ do B=$(echo $F | sed s/.jpg// | sed s/.png//) D=$(dirname $F) - if [ $F -nt $D/thumbnail.jpg ] + if [ $F -nt $D/thumbnail.png ] then PORTRAIT=$(convert $F -format '%[fx:w<h]' info:) @@ -30,17 +30,14 @@ do SIZE_TH=120x120! fi + convert -colorspace RGB -resize $SIZE_TH $F -colorspace sRGB $D/thumbnail.png convert -colorspace RGB -resize $SIZE_1X -colorspace sRGB $F $B.1x.png - pngtopnm $B.1x.png | cjpeg -progressive -optimize -sample 1x1 -quality 95 > $B.1x.jpg - rm -f $B.1x.png - convert -colorspace RGB -resize $SIZE_2X $F -colorspace sRGB $B.2x.png - pngtopnm $B.2x.png | cjpeg -progressive -optimize -sample 1x1 -quality 95 > $B.2x.jpg - rm -f $B.2x.png - convert -colorspace RGB -resize $SIZE_TH $F -colorspace sRGB $D/thumbnail.png + fi + pngtopnm $D/thumbnail.png | cjpeg -progressive -optimize -sample 1x1 -quality 95 > $D/thumbnail.jpg - rm -f $D/thumbnail.png + pngtopnm $B.1x.png | cjpeg -progressive -optimize -sample 1x1 -quality 95 > $B.1x.jpg + pngtopnm $B.2x.png | cjpeg -progressive -optimize -sample 1x1 -quality 95 > $B.2x.jpg - fi done |