#!/bin/bash # invoke as ./generate.sh FILENAME # it is used to generate smaller versions from the one found in scalable FILE=${1#scalable/} PATH=$(dirname $FILE) for VERSION in 16x16 32x32 48x48 64x64 128x128 256x256 do /bin/mkdir -p "cache/$VERSION/$PATH" done echo "$1..." /usr/bin/convert $1 \ \( -clone 0 -resize 16x16 -write cache/16x16/$FILE \) \ \( -clone 0 -resize 32x32 -write cache/32x32/$FILE \) \ \( -clone 0 -resize 48x48 -write cache/48x48/$FILE \) \ \( -clone 0 -resize 64x64 -write cache/64x64/$FILE \) \ \( -clone 0 -resize 128x128 -write cache/128x128/$FILE \) \ \( -clone 0 -resize 256x256 -write cache/256x256/$FILE \) \ null: