[SCM] PostGIS branch master updated. 3.7.0alpha1-651-g590881519

git at osgeo.org git at osgeo.org
Sun Jul 19 17:35:54 PDT 2026


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  590881519946958409ed9cdc9f9f459ab34027d5 (commit)
       via  004d06e76d64b0bba71781cb10a2d4916936c45a (commit)
      from  5f4a33662ea87b0bca09f116655d15ab6ce358be (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 590881519946958409ed9cdc9f9f459ab34027d5
Merge: 5f4a33662 004d06e76
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sun Jul 19 17:35:51 2026 -0700

    Merge pull request 'Fix Make Dist PDF fallback for embedded visual images' (!453) from Komzpa/postgis:fix/master-makedist-data-uri-images into master
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/453


commit 004d06e76d64b0bba71781cb10a2d4916936c45a
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Mon Jul 20 04:25:32 2026 +0400

    doc: rasterize embedded visual example images for PDF

diff --git a/doc/html/images/Makefile.in b/doc/html/images/Makefile.in
index ff15ff30b..b417b93ec 100644
--- a/doc/html/images/Makefile.in
+++ b/doc/html/images/Makefile.in
@@ -26,6 +26,7 @@ INSTALL=@INSTALL@
 INSTALL_DATA=@INSTALL_DATA@
 
 SHELL = @SHELL@
+PERL = @PERL@
 
 VPATH = $(srcdir)
 
@@ -72,14 +73,22 @@ visual-examples-pdf: visual-examples-check
 		target="$(PDF_IMAGES_BUILD_DIR)/$(VISUAL_EXAMPLES_DIR)/$$name.png"; \
 		temporary="$$target.tmp.png"; \
 		diagnostics="$$target.tmp.log"; \
+		embedded_tmpdir=; \
 		rm -f "$$temporary" "$$diagnostics"; \
 		if test "$$rasterizer" = rsvg; then \
 			rsvg-convert -w 1200 -b white -o "$$temporary" "$$source" 2>"$$diagnostics" || \
 				{ cat "$$diagnostics" >&2; exit 1; }; \
 		else \
-			$$converter -density 240 "$$source" -background white -flatten \
+			converter_source="$$source"; \
+			if grep -Eq "(xlink:)?href=['\"]data:image/[^;]+;base64," "$$source"; then \
+				embedded_tmpdir=$$(mktemp -d "$${TMPDIR:-/tmp}/postgis-visual-svg.XXXXXX"); \
+				converter_source="$$embedded_tmpdir/$$name.svg"; \
+				$(PERL) $(srcdir)/prepare-svg-for-converter.pl "$$source" "$$converter_source" "$$embedded_tmpdir" || exit 1; \
+			fi; \
+			$$converter -density 240 "$$converter_source" -background white -flatten \
 				-resize 1200x1200\> "$$temporary" 2>"$$diagnostics" || \
-				{ cat "$$diagnostics" >&2; exit 1; }; \
+				{ cat "$$diagnostics" >&2; test -z "$$embedded_tmpdir" || rm -rf "$$embedded_tmpdir"; exit 1; }; \
+			test -z "$$embedded_tmpdir" || rm -rf "$$embedded_tmpdir"; \
 		fi; \
 		test ! -s "$$diagnostics" || { cat "$$diagnostics" >&2; exit 1; }; \
 		test -s "$$temporary" || { echo "Failed to rasterize $$source" >&2; exit 1; }; \
diff --git a/doc/html/images/prepare-svg-for-converter.pl b/doc/html/images/prepare-svg-for-converter.pl
new file mode 100644
index 000000000..d252ec2dc
--- /dev/null
+++ b/doc/html/images/prepare-svg-for-converter.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use File::Path qw(make_path);
+use MIME::Base64 qw(decode_base64);
+
+my ($source, $target, $asset_dir) = @ARGV;
+die "usage: $0 SOURCE TARGET ASSET_DIR\n" unless defined $asset_dir;
+
+open my $in, '<:raw', $source or die "Cannot read $source: $!\n";
+my $svg = do { local $/; <$in> };
+close $in;
+
+make_path($asset_dir);
+
+my $index = 0;
+$svg =~ s{((?:xlink:)?href)=(['"])data:image/(png|gif|jpe?g);base64,([^'"]+)\2}{
+	my ($attribute, $quote, $extension, $encoded) = ($1, $2, $3, $4);
+	$extension = 'jpg' if $extension eq 'jpeg';
+	my $filename = sprintf('embedded-image-%03d.%s', ++$index, $extension);
+	my $path = "$asset_dir/$filename";
+	open my $out, '>:raw', $path or die "Cannot write $path: $!\n";
+	print {$out} decode_base64($encoded);
+	close $out;
+	qq{$attribute=$quote$path$quote};
+}gex;
+
+open my $out, '>:raw', $target or die "Cannot write $target: $!\n";
+print {$out} $svg;
+close $out;

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

Summary of changes:
 doc/html/images/Makefile.in                  | 13 ++++++++++--
 doc/html/images/prepare-svg-for-converter.pl | 31 ++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 doc/html/images/prepare-svg-for-converter.pl


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list