]> git.sommitrealweird.co.uk Git - bpgallery.git/blobdiff - bpgallery.sh
head command
[bpgallery.git] / bpgallery.sh
index 3d82851af18eda185945a7ef19878a06875483cb..6d38f0f630c1fab67e4e7cafe59f4c2d5902c8d8 100755 (executable)
@@ -49,6 +49,10 @@ 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
@@ -146,7 +150,7 @@ cd icons
 
 for imageext in $IMAGEEXTENSIONS; do
        if ( ls "*.$imageext" > /dev/null 2>/dev/null ); then
-               TEMPMAX=$($IDENTIFYCOMMAND *.$imageext | grep "Geometry:" | sed -r 's#^.*Geometry:.*?[0-9]+x([0-9]+)\+.*$#\1#' | $SORTCOMMAND -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