From: Gael UTARD <[email protected]> The transparent background is rendered with grey by some softwares.
Signed-off-by: Gael UTARD <[email protected]> --- ocitysmap2/__init__.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ocitysmap2/__init__.py b/ocitysmap2/__init__.py index 026e67e..0448507 100644 --- a/ocitysmap2/__init__.py +++ b/ocitysmap2/__init__.py @@ -526,6 +526,13 @@ SELECT ST_AsText(ST_LongestLine( 'Unsupported output format: %s!' % output_format.upper() surface = factory(renderer.paper_width_pt, renderer.paper_height_pt) + + # Set a white background + ctx = cairo.Context(surface) + ctx.set_source_rgb(1, 1, 1) + ctx.rectangle(0, 0, renderer.paper_width_pt, renderer.paper_height_pt) + ctx.fill() + renderer.render(surface, dpi, osm_date) LOG.debug('Writing %s...' % output_filename) -- 1.7.5.4
