+2007-05-15 Brett Parker <iDunno@sommitrealweird.co.uk>
+ * Check that the tools we require exist using the builtin hash function
+ * Minorly reformat changelog
+
2007-05-14 Brett Parker <iDunno@sommitrealweird.co.uk>
* Add in pages directory support through PAGESDIRECTORY variable
* Up'd version number to be +arch as this is still in development
longer hardcoded
2007-05-14 Brett Parker <arch@sommitrealweird.co.uk>
-
* Fix caption generation code
* Released version 1.1.1
2007-05-13 Brett Parker <arch@sommitrealweird.co.uk>
-
* Fix medium sized page generation code
* Fix index page generation
* Released version 1.1.0
2007-05-12 Brett Parker <arch@sommitrealweird.co.uk>
-
* Exit on failure of being able to write medium sized images
* Fix up README to contain the new variables for medium sized images
* Change --replace to -I {} so that the xargs commands work in a BSD
environment.
2006-05-22 Brett Parker <arch@sommitrealweird.co.uk>
-
* Start of 1.1 release development
* Generate medium sized pages
INDEXDOCUMENT
name of the index page (e.g. index.html)
+ PAGESDIRECTORY
+ name of the directory in which to put the pages for fullsized and
+ mediumsized images. Defaults to the image directory. This is
+ relative to the images directory, so, for example,
+ PAGESDIRECTORY=pages would create /path/to/image/files/pages
+
+ MEDIUMDIRECTORY
+ directory to generate medium sized images in, defaults to medium,
+ works the same as the PAGESDIRECTORY variable
+
+ ICONSDIRECTORY
+ directory to generate thumbnails in, defaults to icons, works the
+ same as MEDIUMDIRECTORY and PAGESDIRECTORY
+
Example Usage:
TITLE="My Funky Gallery" bpgallery.sh /path/to/image/files
Theme support is very rudimentary, basically you create functions for each of
the parts of the template, and put them in a file named the same as the theme.
The functions that you need to declare are as follows:
+
+ Available in all templates:
+ ${BASEURL}
+ Base directory (will generate ../ when making pages in a
+ subdirectory for getting to the generated stylesheet or to the
+ index page)
+
bpgallery_ThemeName_head()
what's it for?:
This sets up the header for the page, generally
fi
if [[ -z $CONVERTTOOL ]]; then
- CONVERTTOOL=convert
+ hash convert
+ if [[ $? != 0 ]]; then
+ echo "Can't find convert, exiting"
+ exit 3
+ fi
+ CONVERTTOOL=$(hash -t convert)
+else
+ if [[ ! -x $CONVERTTOOL ]]; then
+ echo "Can't find convert at location $CONVERTTOOL, exiting"
+ exit 3
+ fi
fi
if [[ -z $FINDCOMMAND ]]; then
- FINDCOMMAND=find
+ hash find
+ if [[ $? != 0 ]]; then
+ echo "Can't find find, exiting"
+ exit 3
+ fi
+ FINDCOMMAND=$(hash -t find)
+else
+ if [[ ! -x $FINDCOMMAND ]]; then
+ echo "Can't find find at $FINDCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $XARGSCOMMAND ]]; then
- XARGSCOMMAND=xargs
+ hash xargs
+ if [[ $? != 0 ]]; then
+ echo "Can't find xargs, exiting"
+ exit 3
+ fi
+ XARGSCOMMAND=$(hash -t xargs)
+else
+ if [[ ! -x $XARGSCOMMAND ]]; then
+ echo "Can't find xargs at $XARGSCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $ECHOCOMMAND ]]; then
ECHOCOMMAND=echo
+else
+ if [[ ! -x $ECHOCOMMAND ]]; then
+ echo "Can't find echo at $ECHOCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $SORTCOMMAND ]]; then
- SORTCOMMAND=sort
+ hash sort
+ if [[ $? != 0 ]]; then
+ echo "Can't find sort, exiting"
+ exit 3
+ fi
+ SORTCOMMAND=$(hash -t sort)
+else
+ if [[ ! -x $SORTCOMMAND ]]; then
+ echo "Can't find sort, exiting"
+ exit 3
+ fi
fi
if [[ -z $IDENTIFYCOMMAND ]]; then
- IDENTIFYCOMMAND=identify
+ hash identify
+ if [[ $? != 0 ]]; then
+ echo "Can't find indentify, exiting"
+ exit 3
+ fi
+ IDENTIFYCOMMAND=$(hash -t identify)
+else
+ if [[ ! -x $IDENTIFYCOMMAND ]]; then
+ echo "Can't find identify at $IDENTIFYCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $HEADCOMMAND ]]; then
- HEADCOMMAND=head
+ hash head
+ if [[ $? != 0 ]]; then
+ echo "Can't find head, exiting"
+ exit 3
+ fi
+ HEADCOMMAND=$(hash -t head)
+else
+ if [[ ! -x $HEADCOMMAND ]]; then
+ echo "Can't find head at $HEADCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $GREPCOMMAND ]]; then
- GREPCOMMAND=grep
+ hash grep
+ if [[ $? != 0 ]]; then
+ echo "Can't find grep, exiting"
+ exit 3
+ fi
+ GREPCOMMAND=$(hash -t grep)
+else
+ if [[ ! -x $GREPCOMMAND ]]; then
+ echo "Can't find grep at $GREPCOMMAND, exiting"
+ exit 3
+ fi
fi
if [[ -z $SEDCOMMAND ]]; then
- SEDCOMMAND=sed
+ hash sed
+ if [[ $? != 0 ]]; then
+ echo "Can't find sed, exiting"
+ exit 3
+ fi
+ SEDCOMMAND=$(hash -t sed)
+else
+ if [[ ! -x $SEDCOMMAND ]]; then
+ echo "Can't find sed at $SEDCOMMAND, exiting"
+ exit 3
+ fi
+fi
+
+if [[ -z $WCCOMMAND ]]; then
+ hash wc
+ if [[ $? != 0 ]]; then
+ echo "Can't find wc, exiting"
+ exit 3
+ fi
+ WCCOMMAND=$(hash -t wc)
+ WCCOMMAND="$WCCOMMAND -l"
+else
+ if [[ ! -x $WCCOMMAND ]]; then
+ echo "Can't find wc at $WCCOMMAND, exiting"
+ exit 3
+ fi
+ WCCOMMAND="$WCCOMMAND -l"
fi
if [[ -z $WIDTH ]]; then
IMAGEEXTENSIONS="jpeg jpg gif png";
fi
-if [[ -z $WCCOMMAND ]]; then
- WCCOMMAND="wc -l"
-fi
-
if [[ -z $CAPTIONHEIGHT ]]; then
CAPTIONHEIGHT=75
fi