[MapProxy] Image processing error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[MapProxy] Image processing error

Sebastijan Sekulić
Hi,
so I am trying to add a WMS source to my MapProxy, but on the demo page, I get an error.
Error while processing image file: cannot identify image file <mapproxy.imageReadBufWrapper objerct at 0x7fbed4360f50>.

I have tracked the error to Line 153 in wms.py (It stops at result_bf = result.as_buffer(img_opts)), if that helps. I think it should be something with pillow having a problem with the image format, but I don't have expertise in that.

I don't get any console outputs except request (no errors).

If I make a request with postman or with requests, it renders and downloads properly. The image format is png8, and I am using MapProxy 1.11 on Ubuntu.

If you need .yaml and request, I can provide as a download link or send privately, as I don't want to expose source links.

Thanks,
Seb.

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Image processing error

David Pavlíček
Hi,
did you solve that Issue? I'm experiencing pretty much the same problem. Our MapProxy yesterday starts to respond with: "error while processing image file: cannot identify image file <mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>

I reduce the config to simplest one possible, but with no luck. Error is still there. Our config is as follows:

services:
  demo:
  wms:
    srs: ['EPSG:5514']
sources:
  dtm_praha:
    type: wms
    req:
      url: http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?
      transparent: true
      layers: 0,1,2,3

layers:
  - name: DTMP
    title: DTMP
    sources: [dtm_praha]
globals:
  image:
    resampling_method: bilinear

We are running MapProxy under Apache2 on Debian Linux behind HTTP proxy. Packages up to date. I also try to run developlment server with that config. And output is:

[2018-11-06 13:21:31,681] mapproxy.source.request - INFO - GET http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?styles=&format=image%2Fpng&height=899&bbox=-749443.5125,-1052941.0375,-749412.1875,-1052918.5625&transparent=True&layers=0,1,2,3&service=WMS&srs=EPSG%3A5514&request=GetMap&width=1253&version=1.1.1 200 10.0 330
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - converting image from ImageOptions(encoding_options={}, resampling='bilinear', transparent=True) -> ImageOptions(bgcolor='#ffffff', colors=256, encoding_options={}, format='image/png', resampling='bilinear', transparent=True)
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - file(<mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>) -> image
[info] 10.144.35.192 - - [06/Nov/2018 13:21:31] "GET /wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=DTMP&CRS=EPSG%3A5514&STYLES=&WIDTH=1253&HEIGHT=899&BBOX=-749443.5125000001%2C-1052941.0375%2C-749412.1875000001%2C-1052918.5625 HTTP/1.1" 200 -

But WMS response contains no image, only XML describing error mentioned above.

Any advices?

st 4. 7. 2018 v 15:32 odesílatel Sebastijan Sekulić <[hidden email]> napsal:
Hi,
so I am trying to add a WMS source to my MapProxy, but on the demo page, I get an error.
Error while processing image file: cannot identify image file <mapproxy.imageReadBufWrapper objerct at 0x7fbed4360f50>.

I have tracked the error to Line 153 in wms.py (It stops at result_bf = result.as_buffer(img_opts)), if that helps. I think it should be something with pillow having a problem with the image format, but I don't have expertise in that.

I don't get any console outputs except request (no errors).

If I make a request with postman or with requests, it renders and downloads properly. The image format is png8, and I am using MapProxy 1.11 on Ubuntu.

If you need .yaml and request, I can provide as a download link or send privately, as I don't want to expose source links.

Thanks,
Seb.
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Image processing error

Lukas Macur
Hello, I believe the problem is on source site, that is not working http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer
http://mpp.praha.eu - is working, but the arcgis server services are not ok (http://mpp.praha.eu/arcgis/services).

Regards,
LM


út 6. 11. 2018 v 13:42 odesílatel David Pavlíček <[hidden email]> napsal:
Hi,
did you solve that Issue? I'm experiencing pretty much the same problem. Our MapProxy yesterday starts to respond with: "error while processing image file: cannot identify image file <mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>

I reduce the config to simplest one possible, but with no luck. Error is still there. Our config is as follows:

services:
  demo:
  wms:
    srs: ['EPSG:5514']
sources:
  dtm_praha:
    type: wms
    req:
      url: http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?
      transparent: true
      layers: 0,1,2,3

layers:
  - name: DTMP
    title: DTMP
    sources: [dtm_praha]
globals:
  image:
    resampling_method: bilinear

We are running MapProxy under Apache2 on Debian Linux behind HTTP proxy. Packages up to date. I also try to run developlment server with that config. And output is:

[2018-11-06 13:21:31,681] mapproxy.source.request - INFO - GET http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?styles=&format=image%2Fpng&height=899&bbox=-749443.5125,-1052941.0375,-749412.1875,-1052918.5625&transparent=True&layers=0,1,2,3&service=WMS&srs=EPSG%3A5514&request=GetMap&width=1253&version=1.1.1 200 10.0 330
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - converting image from ImageOptions(encoding_options={}, resampling='bilinear', transparent=True) -> ImageOptions(bgcolor='#ffffff', colors=256, encoding_options={}, format='image/png', resampling='bilinear', transparent=True)
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - file(<mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>) -> image
[info] 10.144.35.192 - - [06/Nov/2018 13:21:31] "GET /wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=DTMP&CRS=EPSG%3A5514&STYLES=&WIDTH=1253&HEIGHT=899&BBOX=-749443.5125000001%2C-1052941.0375%2C-749412.1875000001%2C-1052918.5625 HTTP/1.1" 200 -

But WMS response contains no image, only XML describing error mentioned above.

Any advices?

st 4. 7. 2018 v 15:32 odesílatel Sebastijan Sekulić <[hidden email]> napsal:
Hi,
so I am trying to add a WMS source to my MapProxy, but on the demo page, I get an error.
Error while processing image file: cannot identify image file <mapproxy.imageReadBufWrapper objerct at 0x7fbed4360f50>.

I have tracked the error to Line 153 in wms.py (It stops at result_bf = result.as_buffer(img_opts)), if that helps. I think it should be something with pillow having a problem with the image format, but I don't have expertise in that.

I don't get any console outputs except request (no errors).

If I make a request with postman or with requests, it renders and downloads properly. The image format is png8, and I am using MapProxy 1.11 on Ubuntu.

If you need .yaml and request, I can provide as a download link or send privately, as I don't want to expose source links.

Thanks,
Seb.
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Image processing error

David Pavlíček
I didn't think so...
http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?request=GetCapabilities&service=WMS is working as expected. Also getmap request from debug session is working properly... There must be another issue...


út 6. 11. 2018 v 14:51 odesílatel Lukas Macur <[hidden email]> napsal:
Hello, I believe the problem is on source site, that is not working http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer
http://mpp.praha.eu - is working, but the arcgis server services are not ok (http://mpp.praha.eu/arcgis/services).

Regards,
LM


út 6. 11. 2018 v 13:42 odesílatel David Pavlíček <[hidden email]> napsal:
Hi,
did you solve that Issue? I'm experiencing pretty much the same problem. Our MapProxy yesterday starts to respond with: "error while processing image file: cannot identify image file <mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>

I reduce the config to simplest one possible, but with no luck. Error is still there. Our config is as follows:

services:
  demo:
  wms:
    srs: ['EPSG:5514']
sources:
  dtm_praha:
    type: wms
    req:
      url: http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?
      transparent: true
      layers: 0,1,2,3

layers:
  - name: DTMP
    title: DTMP
    sources: [dtm_praha]
globals:
  image:
    resampling_method: bilinear

We are running MapProxy under Apache2 on Debian Linux behind HTTP proxy. Packages up to date. I also try to run developlment server with that config. And output is:

[2018-11-06 13:21:31,681] mapproxy.source.request - INFO - GET http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?styles=&format=image%2Fpng&height=899&bbox=-749443.5125,-1052941.0375,-749412.1875,-1052918.5625&transparent=True&layers=0,1,2,3&service=WMS&srs=EPSG%3A5514&request=GetMap&width=1253&version=1.1.1 200 10.0 330
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - converting image from ImageOptions(encoding_options={}, resampling='bilinear', transparent=True) -> ImageOptions(bgcolor='#ffffff', colors=256, encoding_options={}, format='image/png', resampling='bilinear', transparent=True)
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - file(<mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>) -> image
[info] 10.144.35.192 - - [06/Nov/2018 13:21:31] "GET /wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=DTMP&CRS=EPSG%3A5514&STYLES=&WIDTH=1253&HEIGHT=899&BBOX=-749443.5125000001%2C-1052941.0375%2C-749412.1875000001%2C-1052918.5625 HTTP/1.1" 200 -

But WMS response contains no image, only XML describing error mentioned above.

Any advices?

st 4. 7. 2018 v 15:32 odesílatel Sebastijan Sekulić <[hidden email]> napsal:
Hi,
so I am trying to add a WMS source to my MapProxy, but on the demo page, I get an error.
Error while processing image file: cannot identify image file <mapproxy.imageReadBufWrapper objerct at 0x7fbed4360f50>.

I have tracked the error to Line 153 in wms.py (It stops at result_bf = result.as_buffer(img_opts)), if that helps. I think it should be something with pillow having a problem with the image format, but I don't have expertise in that.

I don't get any console outputs except request (no errors).

If I make a request with postman or with requests, it renders and downloads properly. The image format is png8, and I am using MapProxy 1.11 on Ubuntu.

If you need .yaml and request, I can provide as a download link or send privately, as I don't want to expose source links.

Thanks,
Seb.
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Image processing error

David Pavlíček
I have finally resolved this issue. It was caused by our http proxy which adds accept-encoding:gzip to all requests. Thus all images were gziped and not readable by PIL.

Some libraries can handle this by checking incoming headers and then decompress content if necessary. But this is not case of urllib2 used by mapproxy. 

So, make sure that your http proxy behaves as expected!

Best regards David



út 6. 11. 2018 15:08 odesílatel David Pavlíček <[hidden email]> napsal:
I didn't think so...
http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?request=GetCapabilities&service=WMS is working as expected. Also getmap request from debug session is working properly... There must be another issue...


út 6. 11. 2018 v 14:51 odesílatel Lukas Macur <[hidden email]> napsal:
Hello, I believe the problem is on source site, that is not working http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer
http://mpp.praha.eu - is working, but the arcgis server services are not ok (http://mpp.praha.eu/arcgis/services).

Regards,
LM


út 6. 11. 2018 v 13:42 odesílatel David Pavlíček <[hidden email]> napsal:
Hi,
did you solve that Issue? I'm experiencing pretty much the same problem. Our MapProxy yesterday starts to respond with: "error while processing image file: cannot identify image file <mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>

I reduce the config to simplest one possible, but with no luck. Error is still there. Our config is as follows:

services:
  demo:
  wms:
    srs: ['EPSG:5514']
sources:
  dtm_praha:
    type: wms
    req:
      url: http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?
      transparent: true
      layers: 0,1,2,3

layers:
  - name: DTMP
    title: DTMP
    sources: [dtm_praha]
globals:
  image:
    resampling_method: bilinear

We are running MapProxy under Apache2 on Debian Linux behind HTTP proxy. Packages up to date. I also try to run developlment server with that config. And output is:

[2018-11-06 13:21:31,681] mapproxy.source.request - INFO - GET http://mpp.praha.eu/arcgis/services/DTMP/DTMP/MapServer/WMSServer?styles=&format=image%2Fpng&height=899&bbox=-749443.5125,-1052941.0375,-749412.1875,-1052918.5625&transparent=True&layers=0,1,2,3&service=WMS&srs=EPSG%3A5514&request=GetMap&width=1253&version=1.1.1 200 10.0 330
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - converting image from ImageOptions(encoding_options={}, resampling='bilinear', transparent=True) -> ImageOptions(bgcolor='#ffffff', colors=256, encoding_options={}, format='image/png', resampling='bilinear', transparent=True)
[2018-11-06 13:21:31,689] mapproxy.image - DEBUG - file(<mapproxy.image.ReadBufWrapper object at 0x7f67d86e6c10>) -> image
[info] 10.144.35.192 - - [06/Nov/2018 13:21:31] "GET /wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=DTMP&CRS=EPSG%3A5514&STYLES=&WIDTH=1253&HEIGHT=899&BBOX=-749443.5125000001%2C-1052941.0375%2C-749412.1875000001%2C-1052918.5625 HTTP/1.1" 200 -

But WMS response contains no image, only XML describing error mentioned above.

Any advices?

st 4. 7. 2018 v 15:32 odesílatel Sebastijan Sekulić <[hidden email]> napsal:
Hi,
so I am trying to add a WMS source to my MapProxy, but on the demo page, I get an error.
Error while processing image file: cannot identify image file <mapproxy.imageReadBufWrapper objerct at 0x7fbed4360f50>.

I have tracked the error to Line 153 in wms.py (It stops at result_bf = result.as_buffer(img_opts)), if that helps. I think it should be something with pillow having a problem with the image format, but I don't have expertise in that.

I don't get any console outputs except request (no errors).

If I make a request with postman or with requests, it renders and downloads properly. The image format is png8, and I am using MapProxy 1.11 on Ubuntu.

If you need .yaml and request, I can provide as a download link or send privately, as I don't want to expose source links.

Thanks,
Seb.
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy