[Zoo-discuss] PNG Parsing in Python

Fenoy Gerald gerald.fenoy at geolabs.fr
Mon Sep 1 00:35:21 PDT 2014


Dear Niels,
thanks a lot for your feedbacks.

I was able to confirm that you were right about the issue by running some tests services.
Now the image encoded in base64 included in the XML should be correct. Note that I also added a default encoding attribute set to base64 in case it is not already defined in the ZCFG file.

This is now fixed in revision 500.

Thanks again,
Best regards,

Le 27 août 2014 à 14:46, Neil Davis <neda at dtu.dk> a écrit :

> I wrote a WPS service in Python that returns a PNG image. The output was defined as    
> 
> <ComplexData>
>     <Default>
>      mimeType = image/png
>     </Default>
>   </ComplexData>
> 
> In python I used cStringIO, to save the PNG to in image and then passed it to outputs using the command:
> outputs['timeseries']['value'] = img_name.getvalue()
> 
> This approach caused the last character of the PNG image string to not be included in the WPS XML output, as was confirmed by running:
> img_name.getvalue().encode("base64").strip()
> 
> This caused a problem when rendering PNG images that ended with two equal-signs. For now I have added a workaround in my javascript, but I think this is a bug in Zoo-WPS with regards to parsing the PNG binary to string.
> 
> Neil
> 
> 
> 
> 
> -- 
> 
>  
> Neil Davis
> Research Assistant
> DTU Wind Energy
>  
> Technical University of Denmark
> <DTU_email_logo_01.gif>
> Department of Wind Energy
> Risø Campus Frederiksborgvej 399, P.O. Box 49
> Building 101
> 4000 Roskilde
> Denmark
> Direct +45 46775067
> neda at dtu.dk
> www.vindenergi.dtu.dk
>  
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss



Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140901/05cf872b/attachment.pgp>


More information about the Zoo-discuss mailing list