Changeset 714

Show
Ignore:
Timestamp:
07/24/08 21:06:09 (6 months ago)
Author:
dave
Message:

Fix the OGCServer (would always throw invalid image format errors)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/bindings/python/mapnik/ogcserver/common.py

    r650 r714  
    2121 
    2222from exceptions import OGCException, ServerConfigurationError 
    23 from mapnik import Map, Color, Envelope, render, rawdata, Image, Projection as MapnikProjection, render_to_file, Coord 
     23from mapnik import Map, Color, Envelope, render, Image, Projection as MapnikProjection, render_to_file, Coord 
    2424from PIL.Image import fromstring, new 
    2525from PIL.ImageDraw import Draw 
     
    3838#                                    }) 
    3939 
    40 PIL_TYPE_MAPPING = {'image/jpeg': 'JPEG', 'image/png': 'PNG'} 
     40PIL_TYPE_MAPPING = {'image/jpeg': 'jpeg', 'image/png': 'png'} 
    4141 
    4242class ParameterDefinition: 
     
    284284        im = Image(params['width'], params['height']) 
    285285        render(m, im) 
    286         return Response(params['format'], im.tostring(params['format']) 
     286        return Response(params['format'], im.tostring(PIL_TYPE_MAPPING[params['format']])) 
    287287 
    288288    def GetFeatureInfo(self, params, querymethodname='query_point'):