[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0beta1-12-ga24263108

git at osgeo.org git at osgeo.org
Sat Jul 15 13:03:00 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  a24263108e1e4cbb2944825e02d9d8221b6ec16d (commit)
      from  7d425cd07457886db65c27c1139c7a545b7c5b99 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a24263108e1e4cbb2944825e02d9d8221b6ec16d
Author: Sandro Santilli <strk at kbt.io>
Date:   Sat Jul 15 22:02:46 2023 +0200

    Add -s switch to generator, use for resized images

diff --git a/doc/html/images/Makefile.in b/doc/html/images/Makefile.in
index a5dfc8c21..7a724d053 100644
--- a/doc/html/images/Makefile.in
+++ b/doc/html/images/Makefile.in
@@ -258,8 +258,7 @@ $(GENERATED_IMAGES): %.png: wkt/%.wkt generator wkt/styles.conf
 
 # Command to resize each of the images
 $(GENERATED_IMAGES_RESIZED): %.png: wkt/%.wkt generator wkt/styles.conf
-	@./generator $< $@
-	convert $@ -resize 100x100 $@
+	./generator -s 100x100 $< $@
 
 # Build the main executable
 generator: $(OBJS) ../../../liblwgeom/.libs/liblwgeom.a
diff --git a/doc/html/images/generator.c b/doc/html/images/generator.c
index 1ddbe0e69..c1c71ccb0 100644
--- a/doc/html/images/generator.c
+++ b/doc/html/images/generator.c
@@ -58,7 +58,7 @@
 bool optionVerbose = false;
 
 // Some global styling variables
-char *imageSize = "200x200";
+const char *imageSize = "200x200";
 
 int getStyleName(char **styleName, char* line);
 
@@ -394,10 +394,14 @@ int parseOptions(int argc, const char* argv[] )
 	if (argc <= 1) return 1;
 
 	int argPos = 1;
-	while (strncmp(argv[argPos], "-", 1) == 0) {
+	while (argPos < argc && strncmp(argv[argPos], "-", 1) == 0) {
 		if (strncmp(argv[argPos], "-v", 2) == 0) {
 			optionVerbose = true;
 		}
+		if (strncmp(argv[argPos], "-s", 2) == 0) {
+			if ( ++argPos >= argc ) return 1;
+			imageSize = argv[argPos];
+		}
 		argPos++;
 	}
 	return argPos;
@@ -422,7 +426,7 @@ int main( int argc, const char* argv[] )
 	int filePos = parseOptions(argc, argv);
 	if ( filePos >= argc || strlen(argv[filePos]) < 3)
 	{
-		lwerror("Usage: %s [-v] <source_wktfile> [<output_pngfile>]", argv[0]);
+		lwerror("Usage: %s [-v] [-s <width>x<height>] <source_wktfile> [<output_pngfile>]", argv[0]);
 		return -1;
 	}
 

-----------------------------------------------------------------------

Summary of changes:
 doc/html/images/Makefile.in |  3 +--
 doc/html/images/generator.c | 10 +++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list