From 660e83d5bd6f0ac2fbed2a6aea0c71b698be8eb7 Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 19 Feb 2023 16:45:23 +0100 Subject: 16x9 and retina fix --- gallery.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gallery.sh') diff --git a/gallery.sh b/gallery.sh index 7e4606a..b7e9b89 100755 --- a/gallery.sh +++ b/gallery.sh @@ -8,7 +8,7 @@ #### Configuration Section ######################################################################################### -MY_HEIGHT_SMALL=187 +MY_HEIGHT_SMALL=406 MY_HEIGHT_LARGE=768 MY_QUALITY=85 MY_THUMBDIR="__thumbs" @@ -22,7 +22,7 @@ MY_CONVERT_COMMAND="convert" MY_EXIF_COMMAND="jhead" # Bootstrap 4 -MY_CSS="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" +MY_CSS="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.2/css/bootstrap.min.css" # Debugging output # true=enable, false=disable @@ -93,7 +93,7 @@ command -v $MY_EXIF_COMMAND >/dev/null 2>&1 || { echo >&2 "!!! $MY_EXIF_COMMAND MY_HEIGHTS[0]=$MY_HEIGHT_SMALL MY_HEIGHTS[1]=$MY_HEIGHT_LARGE -for MY_RES in ${MY_HEIGHTS[*]}; do +for MY_RES in "${MY_HEIGHTS[@]}"; do [[ -d "$MY_THUMBDIR/$MY_RES" ]] || mkdir -p "$MY_THUMBDIR/$MY_RES" || exit 3 done @@ -125,13 +125,14 @@ EOF ### Photos (JPG) if [[ $(find . -maxdepth 1 -type f -iname \*.jpg | wc -l) -gt 0 ]]; then -echo '
' >> "$MY_INDEX_HTML_FILE" +MY_ROWS='3' +echo '
' >> "$MY_INDEX_HTML_FILE" ## Generate Images MY_NUM_FILES=0 for MY_FILENAME in *.[jJ][pP][gG]; do MY_FILELIST[$MY_NUM_FILES]=$MY_FILENAME (( MY_NUM_FILES++ )) - for MY_RES in ${MY_HEIGHTS[*]}; do + for MY_RES in "${MY_HEIGHTS[@]}"; do if [[ ! -s $MY_THUMBDIR/$MY_RES/$MY_FILENAME ]]; then debugOutput "$MY_THUMBDIR/$MY_RES/$MY_FILENAME" $MY_CONVERT_COMMAND -auto-orient -strip -quality $MY_QUALITY -resize x$MY_RES "$MY_FILENAME" "$MY_THUMBDIR/$MY_RES/$MY_FILENAME" @@ -140,7 +141,7 @@ for MY_FILENAME in *.[jJ][pP][gG]; do cat >> "$MY_INDEX_HTML_FILE" << EOF

- Thumbnail: $MY_FILENAME + Thumbnail: $MY_FILENAME

EOF -- cgit v1.2.3