#!/bin/sh
#
# mkthumb_ImageMagick:
# create a png formattet preview image from image formats 
# size is fixed to 128x128 (keeps the ration)
#
# Requires ImageMagick's convert utility.
#       
# Syntax: mkthumb_ImageMagick.sh filename
#
# Supported formats: 
#    see http://www.imagemagick.org/script/formats.php
#    for a full list. 
#    Example:
#        jpg, png, gif, tif, tga, svg, dcr, bmp
#    If GhostScript is installed, you may want to add: 
#        pdf, eps, ps
# --------------------------------------------------------- 
#
# use temp/pvconv_99999.png as outputfile to avoid 
# collisions when multiple converters run in parallel. 

rand=$RANDOM
out=temp/pvconv_${rand}.png
/usr/bin/convert $1 -thumbnail 128x128 $out
echo $out
exit 0
#eof
