[MapProxy] error with "image/png; mode=24bit" format string in client requests

Oliver Tonnhofer olt at omniscale.de
Thu Dec 22 07:14:16 EST 2011


Hi Andrea,

On 22.12.2011, at 10:10, Andrea Pogliaghi wrote:
> I'm using Mapproxy as a caching system between Openlayers and Mapserver and I'm having troubles dealing with 24-bit png's.
> It seems that mapproxy doesn't like the "image/png; mode=24bit" format string, that is required by mapserver to generate 24bit png's.
> 
> In details, in Openlayers I've got a wms layer configured like this:
[...]

You need to configure MapProxy to request images from MapServer with mode=24 and not OpenLayers.

For example:

sources:
  mywms:
    type: wms
    req:
      format: image/png; mode=24bit
      ...

MapProxy will then always request MapServer with that format.


> but Mapproxy is throwing an exception related to  "image/png; mode=24bit" not being in a correct format.
> Here's the stack trace:
[...]
> KeyError: u'image/png; mode=24bit'

Ah, that's a bug. The code that returns standard WMS exceptions for unknown formats did not check for any image options (like mode) and the code fails then later.

It's now fixed in trunk. Thanks for reporting.


Regards,
Oliver

-- 
Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.de
http://mapproxy.org | https://bitbucket.org/olt | @oltonn






More information about the MapProxy mailing list