summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile31
-rwxr-xr-xexamples/gipfel2html47
2 files changed, 66 insertions, 12 deletions
diff --git a/examples/Makefile b/examples/Makefile
index cfea1a6..762fd9e 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,14 +1,15 @@
-images := $(wildcard *.jpg)
-slides := $(addprefix gipfelweb/slides/, $(images))
-thumbs := $(addprefix gipfelweb/thumbs/, $(images))
-html := $(addprefix gipfelweb/, $(addsuffix .html, $(basename $(images))))
-
+images := $(wildcard *.jpg)
+slides := $(addprefix gipfelweb/slides/, $(images))
+thumbs := $(addprefix gipfelweb/thumbs/, $(images))
+positions := $(addprefix gipfelweb/gipfel/, $(addsuffix .pos, $(basename $(images))))
+dumps := $(addprefix gipfelweb/gipfel/, $(addsuffix .gipf, $(basename $(images))))
+html := $(addprefix gipfelweb/, $(addsuffix .html, $(basename $(images))))
all:
echo "make gipfelweb - create a HTML based we of gipfel oriented"
echo "images in the current directory."
-gipfelweb: dirs $(slides) $(thumbs) $(html)
+gipfelweb: dirs $(slides) $(thumbs) $(dumps) $(html)
clean:
rm -rf gipfelweb
@@ -16,16 +17,22 @@ clean:
dirs:
mkdir -p gipfelweb/slides
mkdir -p gipfelweb/thumbs
+ mkdir -p gipfelweb/gipfel
gipfelweb/slides/%.jpg: %.jpg
- anytopnm $< | pamscale -xyfit 200000 600 | convert -unsharp 0.5x0.5 - - | pnmtojpeg -quality=85 > $@
+ convert -resize '10000x600>' -unsharp 0.5x0.5 -quality 90 $< $@
gipfelweb/thumbs/%.jpg: %.jpg
- anytopnm $< | pamscale -xyfit 200000 200 | pnmtojpeg -quality=80 > $@
+ convert -resize '1000x150>' -quality 80 $< $@
+
+gipfelweb/gipfel/%.pos: %.jpg
+ gipfel -e position $< > $@
-gipfelweb/%.html: %.jpg index.gipfel
- echo tbd
+gipfelweb/gipfel/%.gipf: gipfelweb/slides/%.jpg gipfelweb/gipfel/index.gipfel
+ gipfel -v 0.03 -d gipfelweb/gipfel/index.gipfel -e hills $< > $@
-index.gipfel: $(images)
- echo tbd
+gipfelweb/gipfel/index.gipfel: $(positions)
+ cat $(positions) > gipfelweb/gipfel/index.gipfel
+gipfelweb/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.gipf $(thumbs)
+ gipfel2html $* > $@
diff --git a/examples/gipfel2html b/examples/gipfel2html
new file mode 100755
index 0000000..1016b94
--- /dev/null
+++ b/examples/gipfel2html
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+cat << EOF
+<html>
+<head>
+<style type="text/css">
+#gipfel { display: block; position: relative; width: 1536px; height: 864px; margin: 0; padding: 0; }
+#gipfel li { visibility: hidden; list-style-type: none; position: absolute; background: url(25w.png); border: 1px solid black; font-family: sans-serif; font-size: x-small; color: #000; padding: 0; line-height: 1.3em; overflow: hidden; }
+#gipfel span { visibility: hidden; position: absolute; left: 0; right: 0; display: block; padding: 5px; }
+#gipfel:hover li { visibility: visible; }
+#gipfel li:hover span {visibility: visible;}
+EOF
+
+i=0
+grep -v "^#" gipfelweb/gipfel/${1}.gipf | \
+while read name height x y dist flags dummy; do
+ thumb_w=`identify -format %w gipfelweb/thumbs/${name}`
+ thumb_h=`identify -format %h gipfelweb/thumbs/${name}`
+
+ echo "#id_${i} {left:$((${x} - 20 / 2))px; top: $((${y} - 20 / 2))px; width: 20px; height: 20px;}"
+ echo "#id_${i}:hover {width: ${thumb_w}px; height: ${thumb_h}px; background: url(thumbs/${name});}"
+
+ i=$((${i} + 1))
+done
+
+echo "</style></head>"
+echo "<body bgcolor=\"#333333\">"
+echo "<div id=\"gipfel\"><img src=\"slides/${1}.jpg\"/>"
+
+i=0
+grep -v "^#" gipfelweb/gipfel/${1}.gipf | \
+while read name height x y dist flags dummy; do
+ if [ "${flags}" = "HIDDEN" ]; then
+ continue
+ fi
+
+ echo "<li id=\"id_${i}\"><a href=\"${name%.jpg}.html\"><span>${name} (${height}m)</span></a></li>"
+
+ i=$((${i} + 1))
+done
+
+cat << EOF
+</ul>
+</div>
+</body>
+<html>
+EOF