From ef3db06c01a739556cee4183a8a66274459629fb Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Wed, 26 Jan 2005 19:11:19 +0000 Subject: [PATCH] head command * Make the head command also specifiable. git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--0.9.2--patch-3 --- bpgallery.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bpgallery.sh b/bpgallery.sh index 3d82851..6d38f0f 100755 --- a/bpgallery.sh +++ b/bpgallery.sh @@ -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 -- 2.30.2