artemp/tickets2issues — Issue #308: Mapnik produces garbled images from CGIs running on Windows XP/IIS 5.1
Author: artemp
Created: 2011-10-11 15:09:48+00:00
State: open
Labels: Core_Library

Mapnik outputs garbled images to the browser when running as a CGI on WinXP. Closely examined, the image is clearly being rendered with the correct styling and data. Writing the same images to disk using Image.save or render_to_file produces the expected output.
This affects all image formats (jpg, png, png256) but only jpeg is displayed in the browser, with 'The image “http:/[...]” cannot be displayed, because it contains errors.' shown otherwise.

== Steps to replicate ==
*Install from the current Windows binaries (0.5.1). [[BR]]
*Add a virtual directory to IIS, associate .py extension with Python.exe and set up script execution privileges[[BR]]
*Place Mapnikserv.py and mapfile.xml in directory, modified to point to world_borders.shp (from: [http://mapnik-utils.googlecode.com])[[BR]]
*Browse to default Mapnikserv.py url, changing format=png to jpeg

This will produce the attached output.