[mapserver-dev] msautotest-wxs: how to suppress the header
information?
Tamas Szekeres
szekerest at gmail.com
Tue Mar 17 12:51:48 EDT 2009
2009/3/17 Normand Savard <nsavard at mapgears.com>
>
> Tamas,
>
> I checked how the tests works in mstestlib.py and the generated output.
> When it's an wxs tests, if the output result is a png file, it's passed
> through the demime_file() function. This function is called when
> [RESULT_DEMIME] is part of the RUN_PARMS request. It removes the
> Content-type.
>
> For the other tests like the ones in gdal or misc, shp2img is used and
> there is no such thing as Content-type in the png generated.
>
> Maybe I'm missing something so please do not hesitate to comment.
>
>
>
Uh, that explains many things but not all. It appears that this problem
should be dedicated to the difference of the line ending interpretation of
Windows and the Linux OS. On Windows we actually have 2 bytes to represent
the line endings (0x0D 0x0A) which should also be stripped. So the following
function would yield better results:
def demime_file( filename ):
print ' demime %s' % filename
data = open(filename,'rb').read()
for i in range(len(data)-1):
if data[i] == '\n' and data[i+2] == '\n':
open(filename,'wb').write(data[i+3:])
return
return
But I have further issues with the de-stripped png images. It appears that
the result provides invalid image unless I replace each 0x0D 0x0A with
0x0A in the png image file.
Best regards,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20090317/ae3a1908/attachment.html
More information about the mapserver-dev
mailing list