summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-09-20 19:48:29 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-09-20 19:48:29 +0200
commit9d458ef3f8998cdcf9a199f5e96e3bb30e9f5feb (patch)
tree10834a9440369a9a16bd3a9eeab924661f410ee7
parentc07fe54c98eac73c2e517425928ba7eaa0ff4dff (diff)
add back-references in gipfelweb
-rw-r--r--examples/Makefile10
-rwxr-xr-xexamples/gipfel2html26
-rw-r--r--src/GipfelWidget.cxx12
3 files changed, 28 insertions, 20 deletions
diff --git a/examples/Makefile b/examples/Makefile
index f76bc32..0c20df5 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -30,7 +30,7 @@ gipfelweb/slides/%.jpg: %.jpg
jhead -te $< $@
gipfelweb/thumbs/%.jpg: %.jpg
- anytopnm $< | pamscale -xyfit 1000 150 | pnmtojpeg -quality 80 > $@
+ anytopnm $< | pamscale -xyfit 400 50 | pnmtojpeg -quality 80 > $@
gipfelweb/gipfel/%.pos: %.jpg
gipfel -p $< > $@
@@ -47,11 +47,15 @@ gipfelweb/gipfel/%.hills: gipfelweb/slides/%.jpg
gipfelweb/gipfel/index.gipfel: $(positions)
cat $(positions) > gipfelweb/gipfel/index.gipfel
+
+gipfelweb/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.imgs %.title $(thumbs)
+ gipfel2html images "`cat $*.title`" $* > $@
+
gipfelweb/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.imgs $(thumbs)
- gipfel2html images $* > $@
+ gipfel2html images $* $* > $@
gipfelweb/hills/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.hills %.title
gipfel2html hills "`cat $*.title`" $* > $@
gipfelweb/hills/%.html: gipfelweb/slides/%.jpg gipfelweb/gipfel/%.hills
- gipfel2html hills $* $* > $@
+ gipfel2html hills $* $* > $@
diff --git a/examples/gipfel2html b/examples/gipfel2html
index 36720be..0551474 100755
--- a/examples/gipfel2html
+++ b/examples/gipfel2html
@@ -25,10 +25,6 @@ IFS=" "
i=0
grep -v "^#" ${DATAFILE} | \
while read name height x y dist flags dummy; do
- if [ "${flags}" = "HIDDEN" ]; then
- continue
- fi
-
if [ "$MODE" = "images" ]; then
thumb_w=`identify -format %w gipfelweb/thumbs/${name}`
thumb_h=`identify -format %h gipfelweb/thumbs/${name}`
@@ -88,10 +84,6 @@ fi
i=0
grep -v "^#" ${DATAFILE} | \
while read name height x y dist flags dummy; do
- if [ "${flags}" = "HIDDEN" ]; then
- continue
- fi
-
if [ "$MODE" = "images" ]; then
THUMB_TITLE="${name%.jpg}"
if [ -e "${name%.jpg}.title" ]; then
@@ -112,7 +104,23 @@ cat << EOF
</table>
</td></tr>
</table>
-<small>copyright &copy; 2007 <ahref="http://www.ecademix.com/JohannesHofmann/impressum.html">Johannes Hofmann</a></small>
+<br/>
+<br/>
+<br/>
+
+This image is visible on these images:<br/>
+EOF
+
+grep -l ${FILE} gipfelweb/gipfel/*.imgs | \
+while read f; do
+ img="`basename ${f%.imgs}`"
+ echo "<a href=\"${img}.html\"><img src=\"thumbs/${img}.jpg\"></a><br/>"
+done
+
+
+cat << EOF
+</ul>
+<small>copyright &copy; 2007 <a href="http://www.ecademix.com/JohannesHofmann/impressum.html">Johannes Hofmann</a></small>
</body>
</html>
EOF
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 8590b5c..eefefc4 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -735,7 +735,8 @@ GipfelWidget::export_hills(const char *file, FILE *fp) {
int _x = (int) rint(m->x) + w() / 2;
int _y = (int) rint(m->y) + h() / 2;
- if (m->flags & Hill::DUPLICATE || file && !(m->flags & Hill::EXPORT)) {
+ if (m->flags & Hill::DUPLICATE || m->flags & Hill::HIDDEN ||
+ file && !(m->flags & Hill::EXPORT)) {
continue;
}
@@ -743,14 +744,9 @@ GipfelWidget::export_hills(const char *file, FILE *fp) {
continue;
}
- if (m->flags & Hill::HIDDEN) {
- flags = "HIDDEN";
- } else {
- flags = "";
- }
- fprintf(fp, "%s\t%d\t%d\t%d\t%d\t%s\n",
+ fprintf(fp, "%s\t%d\t%d\t%d\t%d\n",
m->name, (int) rint(m->height), _x, _y,
- (int) rint(pan->get_real_distance(m)), flags);
+ (int) rint(pan->get_real_distance(m)));
}
pan->remove_hills(Hill::EXPORT);