[GRASS-SVN] r68946 - in grass/trunk: display/d.northarrow/thumbnails lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 12 11:04:44 PDT 2016
Author: wenzeslaus
Date: 2016-07-12 11:04:44 -0700 (Tue, 12 Jul 2016)
New Revision: 68946
Added:
grass/trunk/display/d.northarrow/thumbnails/1a.png
grass/trunk/display/d.northarrow/thumbnails/1b.png
grass/trunk/display/d.northarrow/thumbnails/2.png
grass/trunk/display/d.northarrow/thumbnails/3.png
grass/trunk/display/d.northarrow/thumbnails/4.png
grass/trunk/display/d.northarrow/thumbnails/5.png
grass/trunk/display/d.northarrow/thumbnails/6.png
grass/trunk/display/d.northarrow/thumbnails/7a.png
grass/trunk/display/d.northarrow/thumbnails/7b.png
grass/trunk/display/d.northarrow/thumbnails/8a.png
grass/trunk/display/d.northarrow/thumbnails/8b.png
grass/trunk/display/d.northarrow/thumbnails/9.png
grass/trunk/display/d.northarrow/thumbnails/arrow1.png
grass/trunk/display/d.northarrow/thumbnails/arrow2.png
grass/trunk/display/d.northarrow/thumbnails/arrow3.png
grass/trunk/display/d.northarrow/thumbnails/basic_compass.png
grass/trunk/display/d.northarrow/thumbnails/fancy_compass.png
grass/trunk/display/d.northarrow/thumbnails/star.png
Removed:
grass/trunk/display/d.northarrow/thumbnails/n_arrow_1a.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_1b.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_2.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_3.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_4.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_5.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_6.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_7a.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_7b.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_8a.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_8b.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_9.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_basic_compass.png
grass/trunk/display/d.northarrow/thumbnails/n_arrow_fancy_compass.png
Modified:
grass/trunk/display/d.northarrow/thumbnails/README
grass/trunk/lib/gis/parser_html.c
Log:
support d.northarrow in parser HTML, use filenames matching options, center drawing in image middle
Added: grass/trunk/display/d.northarrow/thumbnails/1a.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/1a.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/1b.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/1b.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/2.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/3.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/4.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/4.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/5.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/5.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/6.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/6.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/7a.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/7a.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/7b.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/7b.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/8a.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/8a.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/8b.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/8b.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/9.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: grass/trunk/display/d.northarrow/thumbnails/README
===================================================================
--- grass/trunk/display/d.northarrow/thumbnails/README 2016-07-11 20:48:47 UTC (rev 68945)
+++ grass/trunk/display/d.northarrow/thumbnails/README 2016-07-12 18:04:44 UTC (rev 68946)
@@ -9,15 +9,17 @@
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
+#PREFIX=n_arrow_
+PREFIX=""
+
+for STYLE in 1a 1b 2 3 4 5 6 7a 7b 8a 8b 9 fancy_compass basic_compass arrow1 arrow2 arrow3 star
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
+ export GRASS_RENDER_FILE=${PREFIX}${STYLE}.png
+ d.northarrow -t style=${STYLE} at=20,20
+ mogrify -trim ${PREFIX}${STYLE}.png
+ identify -format "%[fx:w]x%[fx:h]" ${PREFIX}${STYLE}.png
+ # first resize it to max size and then place it into a bigger rectangle
+ mogrify -resize 24x24 -background white -gravity Center -extent 24x24 ${PREFIX}${STYLE}.png
+ optipng -o5 ${PREFIX}${STYLE}.png ${PREFIX}${STYLE}.png --quiet
done
-
Added: grass/trunk/display/d.northarrow/thumbnails/arrow1.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/arrow1.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/arrow2.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/arrow2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/arrow3.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/arrow3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/basic_compass.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/basic_compass.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: grass/trunk/display/d.northarrow/thumbnails/fancy_compass.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/fancy_compass.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_1a.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_1b.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_2.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_3.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_4.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_5.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_6.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_7a.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_7b.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_8a.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_8b.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_9.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_basic_compass.png
===================================================================
(Binary files differ)
Deleted: grass/trunk/display/d.northarrow/thumbnails/n_arrow_fancy_compass.png
===================================================================
(Binary files differ)
Added: grass/trunk/display/d.northarrow/thumbnails/star.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/display/d.northarrow/thumbnails/star.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: grass/trunk/lib/gis/parser_html.c
===================================================================
--- grass/trunk/lib/gis/parser_html.c 2016-07-11 20:48:47 UTC (rev 68945)
+++ grass/trunk/lib/gis/parser_html.c 2016-07-12 18:04:44 UTC (rev 68946)
@@ -256,9 +256,13 @@
else if (strcmp(opt->gisprompt,
"old,barscale,barscale") == 0)
thumbnails = "barscales";
-
+ else if (strcmp(opt->gisprompt,
+ "old,northarrow,northarrow") == 0)
+ thumbnails = "northarrows";
+
if (thumbnails)
- fprintf(stdout, "<img width=\"80\" height=\"12\" "
+ fprintf(stdout, "<img height=\"12\" "
+ "style=\"max-width: 80;\""
"src=\"%s/%s.png\" alt=\"%s\"> ",
thumbnails, opt->opts[i], opt->opts[i]);
}
More information about the grass-commit
mailing list