Comments and Defaults

This commit is contained in:
sh+git@codevoid.de 2019-10-23 12:46:19 +00:00
parent 352c6dde4d
commit bc804383a1
2 changed files with 11 additions and 15 deletions

6
README
View File

@ -15,8 +15,4 @@ This will remove all autogenerated files except the generated thumbnail
files. files.
Configuration can be done by altering `mkpicindex.sh`. Configuration Configuration can be done by altering `mkpicindex.sh`. Configuration
variables are at the top. variables are at the top (after the license).
You can create the files HEADER and FOOTER, which will be included
above and below the gallery.

View File

@ -28,13 +28,13 @@ printf '%s' \
' > LICENSE ' > LICENSE
# CONFIGURE # CONFIGURE
GALLERY_TITLE="My Gallery" GALLERY_TITLE="My Gallery" # browser title
GALLERY_ROW_HEIGHT=150 GALLERY_ROW_HEIGHT=150 # how high will the justified rows be?
BODY_STYLE="color:orange; background:black;" BODY_STYLE="color:orange; background:black;" # <body style="?">
THUMBNAIL_QUALITY=83 THUMBNAIL_QUALITY=83 # quality for thumbnails
THUMBNAIL_PATH="thm" THUMBNAIL_PATH="thm" # relative path to thumbnail folder
INCLUDE_FOOTER="FOOTER" INCLUDE_HEADER="HEADER" # file with html to include before gallery
INCLUDE_HEADER="HEADER" INCLUDE_FOOTER="FOOTER" # file with html to include after gallery
### ZE PROGAM STARTZ HERE ############################################## ### ZE PROGAM STARTZ HERE ##############################################
cleanup() { cleanup() {
@ -65,7 +65,7 @@ printf '%s%s%s%s%s\n' \
<div id="base">' <div id="base">'
# RESCALE AND PRINT IMAGE SOURCE # RESCALE AND ADD IMAGE
# PARAM 1: original # PARAM 1: original
# 2: thumbnail_basename # 2: thumbnail_basename
# 3: thumbnail_format (extension) # 3: thumbnail_format (extension)
@ -76,7 +76,7 @@ add_image() {
printf '%s\n' "Adding image: $FILE" >&2 printf '%s\n' "Adding image: $FILE" >&2
if ! [ -f "$THUMB.$EXT" ] && [ "$FILE" != "$THUMB.$EXT" ]; if ! [ -f "$THUMB.$EXT" ] && [ "$FILE" != "$THUMB.$EXT" ];
then convert -quality $THUMBNAIL_QUALITY -sharpen 2x2 \ then convert -quality $THUMBNAIL_QUALITY -sharpen 2x2 \
-coalesce -resize 1600x$GALLERY_ROW_HEIGHT\> \ -coalesce -resize 6000x$GALLERY_ROW_HEIGHT\> \
-deconstruct "$FILE" "${THUMB}_tmp.$EXT" && \ -deconstruct "$FILE" "${THUMB}_tmp.$EXT" && \
mv "${THUMB}_tmp.$EXT" "$THUMB.$EXT" mv "${THUMB}_tmp.$EXT" "$THUMB.$EXT"
fi fi
@ -84,7 +84,7 @@ add_image() {
| awk '{ print "width="$1" height="$2 }')" | awk '{ print "width="$1" height="$2 }')"
printf ' %s\n' "<a href=\"$FILE\">" printf ' %s\n' "<a href=\"$FILE\">"
printf ' %s\n' "<img $WH src=\"$THUMB.$EXT\">" printf ' %s\n' "<img $WH src=\"$THUMB.$EXT\">"
printf ' %s\n' "</a>" printf ' %s\n' '</a>'
} }
### MAIN LOOP ########################################################## ### MAIN LOOP ##########################################################