Fix the image height code
[bpgallery.git] / bpgallery.sh
index 96cd77f97350dc4f271cc86bd83c4e3290b68192..ef403e75db53369134e680b595f4488e4402f535 100755 (executable)
@@ -19,7 +19,7 @@
 
 set -f
 
-VERSION="0.9.2+arch"
+VERSION="0.9.3"
 
 function bpgallery_default_head() {
 cat <<END
@@ -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