render and crop directly with rsvg/cairo

This commit is contained in:
Laura Klünder 2017-10-17 14:34:09 +02:00
parent 8a66b36ecc
commit 2789fe3472
2 changed files with 35 additions and 26 deletions

View file

@ -30,7 +30,8 @@ def tile(request, level, zoom, x, y, format):
if format == 'svg':
response = HttpResponse(svg.get_xml(), 'image/svg+xml')
elif format == 'png':
response = HttpResponse(svg.get_png(), 'image/png')
response = HttpResponse(content_type='image/png')
svg.get_png(f=response)
else:
raise ValueError