t* Simple Justified Gallery
URI git clone git://git.codevoid.de/mkpicindex
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR commit 2e287bdfb39f97115d787ce5d01f5d0217253ec2
DIR parent 17d25987d3e034c4d029efd47bc9ca03bfba9a75
URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
Date: Wed, 23 Oct 2019 14:46:19 +0200
Comments and Defaults
Diffstat:
M README | 6 +-----
M mkpicindex.sh | 20 ++++++++++----------
2 files changed, 11 insertions(+), 15 deletions(-)
---
DIR diff --git a/README b/README
t@@ -15,8 +15,4 @@ This will remove all autogenerated files except the generated thumbnail
files.
Configuration can be done by altering `mkpicindex.sh`. Configuration
-variables are at the top.
-
-You can create the files HEADER and FOOTER, which will be included
-above and below the gallery.
-
+variables are at the top (after the license).
DIR diff --git a/mkpicindex.sh b/mkpicindex.sh
t@@ -28,13 +28,13 @@ printf '%s' \
' > LICENSE
# CONFIGURE
-GALLERY_TITLE="My Gallery"
-GALLERY_ROW_HEIGHT=150
-BODY_STYLE="color:orange; background:black;"
-THUMBNAIL_QUALITY=83
-THUMBNAIL_PATH="thm"
-INCLUDE_FOOTER="FOOTER"
-INCLUDE_HEADER="HEADER"
+GALLERY_TITLE="My Gallery" # browser title
+GALLERY_ROW_HEIGHT=150 # how high will the justified rows be?
+BODY_STYLE="color:orange; background:black;" # <body style="?">
+THUMBNAIL_QUALITY=83 # quality for thumbnails
+THUMBNAIL_PATH="thm" # relative path to thumbnail folder
+INCLUDE_HEADER="HEADER" # file with html to include before gallery
+INCLUDE_FOOTER="FOOTER" # file with html to include after gallery
### ZE PROGAM STARTZ HERE ##############################################
cleanup() {
t@@ -65,7 +65,7 @@ printf '%s%s%s%s%s\n' \
<div id="base">'
-# RESCALE AND PRINT IMAGE SOURCE
+# RESCALE AND ADD IMAGE
# PARAM 1: original
# 2: thumbnail_basename
# 3: thumbnail_format (extension)
t@@ -76,7 +76,7 @@ add_image() {
printf '%s\n' "Adding image: $FILE" >&2
if ! [ -f "$THUMB.$EXT" ] && [ "$FILE" != "$THUMB.$EXT" ];
then convert -quality $THUMBNAIL_QUALITY -sharpen 2x2 \
- -coalesce -resize 1600x$GALLERY_ROW_HEIGHT\> \
+ -coalesce -resize 6000x$GALLERY_ROW_HEIGHT\> \
-deconstruct "$FILE" "${THUMB}_tmp.$EXT" && \
mv "${THUMB}_tmp.$EXT" "$THUMB.$EXT"
fi
t@@ -84,7 +84,7 @@ add_image() {
| awk '{ print "width="$1" height="$2 }')"
printf ' %s\n' "<a href=\"$FILE\">"
printf ' %s\n' "<img $WH src=\"$THUMB.$EXT\">"
- printf ' %s\n' "</a>"
+ printf ' %s\n' '</a>'
}
### MAIN LOOP ##########################################################