elif form.getvalue("format") == "jpeg":
image = mapnik.Image(map.width, map.height)
mapnik.render(map, image)
jpeg = image.tostring("jpeg")
output_headers("image/jpeg", "map.jpg", len(jpeg))
elif form.getvalue("format") == "jpeg":
image = mapnik.Image(map.width, map.height)
mapnik.render(map, image)
jpeg = image.tostring("jpeg")
output_headers("image/jpeg", "map.jpg", len(jpeg))