diff options
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-x | testxml/testxml.py | 15 |
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) |