MCPcopy Index your code
hub / github.com/plotly/plotly.py / decompress

Function decompress

_plotly_utils/png.py:2171–2187  ·  view source on GitHub ↗

`data_blocks` should be an iterable that yields the compressed data (from the ``IDAT`` chunks). This yields decompressed byte strings.

(data_blocks)

Source from the content-addressed store, hash-verified

2169
2170
2171def decompress(data_blocks):
2172 """
2173 `data_blocks` should be an iterable that
2174 yields the compressed data (from the ``IDAT`` chunks).
2175 This yields decompressed byte strings.
2176 """
2177
2178 # Currently, with no max_length parameter to decompress,
2179 # this routine will do one yield per IDAT chunk: Not very
2180 # incremental.
2181 d = zlib.decompressobj()
2182 # Each IDAT chunk is passed to the decompressor, then any
2183 # remaining state is decompressed out.
2184 for data in data_blocks:
2185 # :todo: add a max_length argument here to limit output size.
2186 yield bytearray(d.decompress(data))
2187 yield bytearray(d.flush())
2188
2189
2190def check_bitdepth_colortype(bitdepth, colortype):

Callers 1

readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected