Sfoglia il codice sorgente

d.northarrow: thumbnails added (trac https://trac.osgeo.org/grass/ticket/3032)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68945 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 8 anni fa
parent
commit
19fc994c6c

+ 11 - 1
display/d.northarrow/Makefile

@@ -7,4 +7,14 @@ DEPENDENCIES = $(DISPLAYDEP) $(SYMBDEP) $(GISDEP)
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: cmd
+# thumbnail previews
+IMGSRC := $(wildcard thumbnails/*.png)
+IMGDST := $(patsubst thumbnails/%,$(HTMLDIR)/northarrows/%,$(IMGSRC))
+
+default: cmd $(IMGDST)
+
+$(HTMLDIR)/northarrows/%.png: thumbnails/%.png | $(HTMLDIR)/northarrows
+	$(INSTALL_DATA) $< $@
+
+$(HTMLDIR)/northarrows: $(HTMLDIR)
+	$(MKDIR) $@

+ 23 - 0
display/d.northarrow/thumbnails/README

@@ -0,0 +1,23 @@
+#How to generate new scale bar thumbnail
+#=======================================
+#Expects North Carolina dataset. The thumbnail height should be 24 px.
+#
+
+export GRASS_RENDER_IMMEDIATE=png
+export GRASS_RENDER_TRUECOLOR=TRUE
+export GRASS_RENDER_WIDTH=300
+export GRASS_RENDER_HEIGHT=300
+g.region raster=elevation
+
+for STYLE in 1a 1b 2 3 4 5 6 7a 7b 8a 8b 9 fancy_compass basic_compass
+do
+	echo ${STYLE}
+	export GRASS_RENDER_FILE=n_arrow_${STYLE}.png
+	d.northarrow style=${STYLE} at=20,20
+	mogrify -trim n_arrow_${STYLE}.png
+	identify -format "%[fx:w]x%[fx:h]" n_arrow_${STYLE}.png
+#	convert n_arrow_${STYLE}.png -gravity center -background white -extent 170x24 n_arrow_${STYLE}.png
+	convert n_arrow_${STYLE}.png -gravity center -background white n_arrow_${STYLE}.png
+	optipng -o5 n_arrow_${STYLE}.png n_arrow_${STYLE}.png --quiet
+done
+

BIN
display/d.northarrow/thumbnails/n_arrow_1a.png


BIN
display/d.northarrow/thumbnails/n_arrow_1b.png


BIN
display/d.northarrow/thumbnails/n_arrow_2.png


BIN
display/d.northarrow/thumbnails/n_arrow_3.png


BIN
display/d.northarrow/thumbnails/n_arrow_4.png


BIN
display/d.northarrow/thumbnails/n_arrow_5.png


BIN
display/d.northarrow/thumbnails/n_arrow_6.png


BIN
display/d.northarrow/thumbnails/n_arrow_7a.png


BIN
display/d.northarrow/thumbnails/n_arrow_7b.png


BIN
display/d.northarrow/thumbnails/n_arrow_8a.png


BIN
display/d.northarrow/thumbnails/n_arrow_8b.png


BIN
display/d.northarrow/thumbnails/n_arrow_9.png


BIN
display/d.northarrow/thumbnails/n_arrow_basic_compass.png


BIN
display/d.northarrow/thumbnails/n_arrow_fancy_compass.png