From 6f5f10d0cb472ac7e776a607b769cac7009888c0 Mon Sep 17 00:00:00 2001 From: Lorenzo Cogotti Date: Wed, 23 Mar 2022 08:34:10 +0100 Subject: [PATCH] [themes/mkfavicons.sh->themes/mkimgmaps.sh] Rename and improve. mkfavicons.sh also manages general mipmaps generation now, thus it has been renamed accordingly. --- themes/doublefourteen/mkfavicons.sh | 25 ---------------- themes/doublefourteen/mkimgmips.sh | 44 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 25 deletions(-) delete mode 100755 themes/doublefourteen/mkfavicons.sh create mode 100755 themes/doublefourteen/mkimgmips.sh diff --git a/themes/doublefourteen/mkfavicons.sh b/themes/doublefourteen/mkfavicons.sh deleted file mode 100755 index d39f77c..0000000 --- a/themes/doublefourteen/mkfavicons.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -for i in 152 144 120 114 180; do - rsvg-convert -f png -w $i -h $i "static/favicon.svg" > "static/favicon-$i-precomposed.png" - pngcrush -reduce -brute -ow "static/favicon-$i-precomposed.png" -done -for i in 57 32; do - rsvg-convert -f png -w $i -h $i "static/favicon.svg" > "static/favicon-$i.png" - pngcrush -reduce -brute -ow "static/favicon-$i.png" -done - -convert "static/favicon.svg" -bordercolor white -border 0 \ - \( -clone 0 -resize 16x16 \) \ - \( -clone 0 -resize 32x32 \) \ - \( -clone 0 -resize 48x48 \) \ - \( -clone 0 -resize 57x57 \) \ - \( -clone 0 -resize 64x64 \) \ - \( -clone 0 -resize 72x72 \) \ - \( -clone 0 -resize 110x110 \) \ - \( -clone 0 -resize 114x114 \) \ - \( -clone 0 -resize 120x120 \) \ - \( -clone 0 -resize 128x128 \) \ - \( -clone 0 -resize 144x144 \) \ - \( -clone 0 -resize 152x152 \) \ - -delete 0 -alpha off -colors 256 "static/favicon.ico" diff --git a/themes/doublefourteen/mkimgmips.sh b/themes/doublefourteen/mkimgmips.sh new file mode 100755 index 0000000..56de7c9 --- /dev/null +++ b/themes/doublefourteen/mkimgmips.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +readonly PNGCRUSHOPTS="-reduce -brute -ow" + +# Favicon +######### + +for i in 152 144 120 114 180; do + rsvg-convert -f png -w ${i} -h ${i} "static/favicon.svg" > "static/favicon-${i}-precomposed.png" + pngcrush ${PNGCRUSHOPTS} "static/favicon-${i}-precomposed.png" +done +for i in 57 32; do + rsvg-convert -f png -w ${i} -h ${i} "static/favicon.svg" > "static/favicon-${i}.png" + pngcrush ${PNGCRUSHOPTS} "static/favicon-${i}.png" +done + +convert "static/favicon.svg" -bordercolor white -border 0 \ + \( -clone 0 -resize 16x16 \) \ + \( -clone 0 -resize 32x32 \) \ + \( -clone 0 -resize 48x48 \) \ + \( -clone 0 -resize 57x57 \) \ + \( -clone 0 -resize 64x64 \) \ + \( -clone 0 -resize 72x72 \) \ + \( -clone 0 -resize 110x110 \) \ + \( -clone 0 -resize 114x114 \) \ + \( -clone 0 -resize 120x120 \) \ + \( -clone 0 -resize 128x128 \) \ + \( -clone 0 -resize 144x144 \) \ + \( -clone 0 -resize 152x152 \) \ + -delete 0 -alpha off -colors 256 "static/favicon.ico" + +# Other scalable logos/images +############################# + +for i in 16 32 48 57 64 72 110 114 120 128; do + NAMBLUE="twitter-logo-blue-${i}x${i}.png" + NAMWHIT="twitter-logo-white-${i}x${i}.png" + + convert "static/twitter-logo-blue.png" -resize ${i}x${i} "static/${NAMBLUE}" + pngcrush ${PNGCRUSHOPTS} "static/${NAMBLUE}" + convert "static/twitter-logo-white.png" -resize ${i}x${i} "static/${NAMWHIT}" + pngcrush ${PNGCRUSHOPTS} "static/${NAMWHIT}" +done +