From: Brett Parker Date: Sat, 22 Dec 2007 19:13:12 +0000 (+0000) Subject: * Add support for bounding box based image resize X-Git-Tag: release-1.1.2~3 X-Git-Url: https://git.sommitrealweird.co.uk/bpgallery.git/commitdiff_plain/bd2b083210e038f02bd8ee677c0e7772d372c3a0?ds=sidebyside * Add support for bounding box based image resize * Remove related item from TODO list --- diff --git a/TODO b/TODO index 2d86dd2..c351507 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,2 @@ -* Allow a fixed height to be specified instead or as well as a fixed width, in - the latter case, resize to which ever fits the bounding box, but keep the - aspect ratio. * Allow ordering of images rather than the current "sort" based algorithm on filename. diff --git a/bpgallery.sh b/bpgallery.sh index d26821a..ade52a5 100755 --- a/bpgallery.sh +++ b/bpgallery.sh @@ -567,11 +567,19 @@ function generate_resized_images() { } function generate_thumbs() { - generate_resized_images $WIDTH $ICONSDIRECTORY + if [[ ! -z $HEIGHT ]]; then + generate_resized_images "${WIDTH}x${HEIGHT}" $ICONSDIRECTORY + else + generate_resized_images $WIDTH $ICONSDIRECTORY + fi } function generate_medium() { - generate_resized_images $MEDIUMWIDTH $MEDIUMDIRECTORY + if [[ ! -z $MEDIUMHEIGHT ]]; then + generate_resized_images "${WIDTH}x${HEIGHT}" $MEDIUMDIRECTORY + else + generate_resized_images $MEDIUMWIDTH $MEDIUMDIRECTORY + fi } function generate_pages() {