From 042589d39cb987008666e671444f0b8e40b38e74 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 8 Feb 2021 13:08:30 +0100 Subject: Add archive --- gal | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gal') diff --git a/gal b/gal index 24da9fd..6dbcfd4 100755 --- a/gal +++ b/gal @@ -15,7 +15,8 @@ RESOLUTION=1500 ## ================= - +[ -z $1 ] && echo "You need to pass photos dir" && exit 1 +[ -z $2 ] && echo "You need to pass output dir" && exit 1 PHOTOS=$1 OUTPUT=$2 @@ -61,6 +62,7 @@ done cat >> $OUTPUT/index.html < @@ -88,3 +90,7 @@ for f in $PHOTOS/*.{jpg,JPG,jpeg,JPEG,png,PNG}; do convert -auto-orient -strip -quality $QUALITY -resize x$THUMBNAIL_RESOLUTION "$f" "$OUTPUT/thumbs/$filename" && \ cwebp -q $QUALITY -resize 400 0 $f -o "$OUTPUT/thumbs/${filename%.*}.webp" done + +## Create zip archive + +zip $OUTPUT/"archive_$TITLE.zip" -r $OUTPUT/photos -- cgit 1.4.1