From 9b5cf664e4975fc26825a031a1f0cc3c492e72e7 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Wed, 11 Jul 2012 13:27:25 +0200 Subject: [PATCH] Initial commit --- .gitignore | 7 +++++++ Makefile | 28 ++++++++++++++++++++++++++++ jpg2html.sh | 41 +++++++++++++++++++++++++++++++++++++++++ tmpl_f.html | 30 ++++++++++++++++++++++++++++++ tmpl_h.html | 12 ++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100755 jpg2html.sh create mode 100644 tmpl_f.html create mode 100644 tmpl_h.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1db4f6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +htc +sony +sony_raw +pictest +index.html +big.zip +small.zip diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..45424fa --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SHELL := bash + +#PICS := $(wildcard pictest/DSC?????.jpg) +PICS := $(wildcard sony/DSC?????.jpg) +# PICS := $(wildcard sony/DSC?????.jpg htc/IMG_*_??????.jpg) +SMALL := $(PICS:.jpg=_small.jpg) +THUMB := $(PICS:.jpg=_thumb.jpg) + + +all: $(SMALL) $(THUMB) small.zip big.zip + ./jpg2html.sh + +%_small.jpg: %.jpg + exiftran -a -i $< + convert -scale 800x800 $< $@ + +%_thumb.jpg: %_small.jpg + convert -scale 80x80 $< $@ + +big.zip: $(PICS) + zip -r $@ $^ + +small.zip: $(SMALL) + zip -r $@ $^ + +.PHONY: all clean +clean: + rm -rf sony/*_{small,thumb}.jpg sony/*.html index.html *.zip diff --git a/jpg2html.sh b/jpg2html.sh new file mode 100755 index 0000000..5a6d5a0 --- /dev/null +++ b/jpg2html.sh @@ -0,0 +1,41 @@ +#!/bin/zsh + +files=(sony/DSC?????.jpg) +len=${#files[@]}; + +touch all.tmp +for i in `seq 1 $len `; do + touch tmp + + if [ $i -ne 1 ]; then + prev=$files[$(($i - 1))]; + bn_prev=${prev/.jpg/} + printf "prev\n" $bn_prev >> tmp + fi + + printf "all\n" >> tmp + + if [ $i -ne $len ]; then + next=$files[(($i + 1))]; + bn_next=${next/.jpg/} + printf "next\n" $bn_next >> tmp + fi + + this=$files[$i]; + bn_this=${this/.jpg/} + printf "\n" $bn_this.html $bn_this >> all.tmp + + printf "
" >> tmp + printf "\n" $this $bn_this >> tmp + + if [ -f $bn_this.desc ]; then + printf "
\n" >> tmp + cat $bn_this.desc >> tmp + fi + + cat tmpl_h.html tmp tmpl_f.html > $bn_this.html + rm tmp +done + +cat tmpl_h.html all.tmp tmpl_f.html > index.html +rm all.tmp diff --git a/tmpl_f.html b/tmpl_f.html new file mode 100644 index 0000000..eb064c4 --- /dev/null +++ b/tmpl_f.html @@ -0,0 +1,30 @@ +


+ +
+ + Valid XHTML 1.0 Transitional + + + + Valid CSS! + +

+
+ + + + + diff --git a/tmpl_h.html b/tmpl_h.html new file mode 100644 index 0000000..2dff040 --- /dev/null +++ b/tmpl_h.html @@ -0,0 +1,12 @@ + + + + + + dreadcut party, 07/07/2012 + + + +

dreadcut party, 07/07/2012

+

-- 2.25.1