#!/bin/ash
# create thumbnail for gimp compressed image (.xcf.bz2)
# $1-path to source, $2-path to output, $3-pixel size 

# this works but slow - and gimp may deposit the thumbnail in the wrong place
# because we only use $1 here,
#exec gimp -ic -b "(rox-create-thumbnail \"$1\")" -b '(gimp-quit 0)'

# this depends on xcftools but fast and always put in the right place
# we use all the 3 parameters
exec xcf2pnm "$1" -A -a /dev/null | pnmscale -width "$3" | pnmtopng > "$2"
