Skip to content

Commit

Permalink
Add archive
Browse files Browse the repository at this point in the history
  • Loading branch information
pniedzwiedzinski committed Feb 8, 2021
1 parent d9eb1ef commit 042589d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -61,6 +62,7 @@ done
cat >> $OUTPUT/index.html <<EOF
</div>
<footer>
<p>Pobierz: <a href="archive_$TITLE.zip">📁 Archiwum</a></p>
<p>This page is <a href="https://jeffhuang.com/designed_to_last/">designed to last</a>.</p>
</footer>
</body>
Expand Down Expand Up @@ -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

0 comments on commit 042589d

Please sign in to comment.