X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/blobdiff_plain/cdb23c0adbd2286f0aec1d8b269621fecd1420d5..ef3db06c01a739556cee4183a8a66274459629fb:/bpgallery.sh diff --git a/bpgallery.sh b/bpgallery.sh index d95049e..6d38f0f 100755 --- a/bpgallery.sh +++ b/bpgallery.sh @@ -41,12 +41,24 @@ if [[ -z $ECHOCOMMAND ]]; then ECHOCOMMAND=/bin/echo fi +if [[ -z $SORTCOMMAND ]]; then + SORTCOMMAND=/usr/bin/sort +fi + +if [[ -z $IDENTIFYCOMMAND ]]; then + IDENTIFYCOMMAND=/usr/bin/identify +fi + +if [[ -z $HEADCOMMAND ]]; then + HEADCOMMAND=/usr/bin/head +fi + if [[ -z $WIDTH ]]; then WIDTH=100 fi if [[ -z $IMAGEEXTENSIONS ]]; then - IMAGEEXTENSIONS="jpg gif png"; + IMAGEEXTENSIONS="jpeg jpg gif png"; fi FINDIMAGESOPTIONS="" @@ -126,7 +138,7 @@ cat < index.html END -$FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} |sort -g | sed -e 's#^./\(.*\)$#
#' >> index.html +$FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} |$SORTCOMMAND -g | sed -e 's#^./\(.*\)$#
#' >> index.html cat <> index.html @@ -138,7 +150,7 @@ cd icons for imageext in $IMAGEEXTENSIONS; do if ( ls "*.$imageext" > /dev/null 2>/dev/null ); then - TEMPMAX=$(identify *.jpg | grep "Geometry:" | sed -r 's#^.*Geometry:.*?[0-9]+x([0-9]+)\+.*$#\1#' | sort -g -r | head -n 1) + TEMPMAX=$($IDENTIFYCOMMAND *.$imageext | grep "Geometry:" | sed -r 's#^.*Geometry:.*?[0-9]+x([0-9]+)\+.*$#\1#' | $SORTCOMMAND -g -r | $HEADCOMMAND -n 1) if [[ $TEMPMAX -gt $MAXHEIGHT ]]; then MAXHEIGHT=$TEMPMAX fi