fi
if [[ -z $CONVERTTOOL ]]; then
- CONVERTTOOL="/usr/bin/convert"
+ CONVERTTOOL=convert
fi
if [[ -z $FINDCOMMAND ]]; then
- FINDCOMMAND=/usr/bin/find
+ FINDCOMMAND=find
fi
if [[ -z $XARGSCOMMAND ]]; then
- XARGSCOMMAND=/usr/bin/xargs
+ XARGSCOMMAND=xargs
fi
if [[ -z $ECHOCOMMAND ]]; then
- ECHOCOMMAND=/bin/echo
+ ECHOCOMMAND=echo
fi
if [[ -z $SORTCOMMAND ]]; then
- SORTCOMMAND=/usr/bin/sort
+ SORTCOMMAND=sort
fi
if [[ -z $IDENTIFYCOMMAND ]]; then
- IDENTIFYCOMMAND=/usr/bin/identify
+ IDENTIFYCOMMAND=identify
fi
if [[ -z $HEADCOMMAND ]]; then
- HEADCOMMAND=/usr/bin/head
+ HEADCOMMAND=head
fi
if [[ -z $WIDTH ]]; then
IMAGEEXTENSIONS="jpeg jpg gif png";
fi
+if [[ -z $WCCOMMAND ]]; then
+ WCCOMMAND="wc -l"
+fi
+
FINDIMAGESOPTIONS=""
for imageext in $IMAGEEXTENSIONS; do
exit 3
fi
-$FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $CONVERTTOOL -resize $WIDTH '{}' 'icons/{}'
+totalimages=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace echo {} | $WCCOMMAND);
+currentimage=0
+
+$FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --verbose --max-procs=4 --replace $CONVERTTOOL -resize $WIDTH '{}' 'icons/{}' 2>&1 | while read throwout; do echo done: $currentimage/$totalimages images; currentimage=$((currentimage+1)); done
+
+echo done: $totalimages/$totalimages images
cat <<END > index.html
<?xml version="1.0"?>