]> git.sommitrealweird.co.uk Git - bpgallery.git/blobdiff - bpgallery.sh
Fix the image height code
[bpgallery.git] / bpgallery.sh
index 719ff9cc3943529eea5e73d95f977b5a799b5671..ef403e75db53369134e680b595f4488e4402f535 100755 (executable)
@@ -254,17 +254,12 @@ $BPGALLERY_TAIL_FUNCTION >> index.html
 
 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 | $HEADCOMMAND -n 1)
-               if [[ $TEMPMAX -gt $MAXHEIGHT ]]; then
-                       MAXHEIGHT=$TEMPMAX
-               fi
-       fi
-done
+MAXHEIGHT=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 $IDENTIFYCOMMAND -format "%h\n" | $GREPCOMMAND -v "^$" | $SORTCOMMAND -g -r | $HEADCOMMAND -n 1)
 
 cd ..
 
+# add a bit to the maxheight for the size of the caption
+MAXHEIGHT=$((MAXHEIGHT+75))
 
 $BPGALLERY_STYLESHEET_FUNCTION > style.css