summaryrefslogtreecommitdiff
path: root/testxml/testxml.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-25 23:40:06 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-25 23:40:06 +0200
commit681d7043043f29c6fa841371ade4bfa97a5a34a5 (patch)
treee34a2513f755650b212c9951a453b5360f349869 /testxml/testxml.py
parentf83a0078b6faf4c094cdd7777b193534be7b4272 (diff)
downloadevol-tools-681d7043043f29c6fa841371ade4bfa97a5a34a5.tar.gz
evol-tools-681d7043043f29c6fa841371ade4bfa97a5a34a5.tar.bz2
evol-tools-681d7043043f29c6fa841371ade4bfa97a5a34a5.tar.xz
evol-tools-681d7043043f29c6fa841371ade4bfa97a5a34a5.zip
testxml: add support for zlib map layer compression.
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-xtestxml/testxml.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index 520430c..86a6cae 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -1181,12 +1181,19 @@ def testLayer(file, node, name, width, height, layer, tiles):
compression = ""
if encoding == "base64":
if compression != "gzip":
- showMsgFile(file, "invalid compression " + compression + \
- " in layer: " + name, True)
- continue
+ if compression != "zlib":
+ showMsgFile(file, "invalid compression " + compression + \
+ " in layer: " + name, True)
+ continue
+ else:
+ showMsgFile(file, "not supported compression by old clients " \
+ + compression + " in layer: " + name, False)
binData = data.childNodes[0].data.strip()
binData = binData.decode('base64')
- dc = zlib.decompressobj(16 + zlib.MAX_WBITS)
+ if compression == "gzip":
+ dc = zlib.decompressobj(16 + zlib.MAX_WBITS)
+ else:
+ dc = zlib.decompressobj()
layerData = dc.decompress(binData)
arr = array.array("B")
arr.fromstring(layerData)