|
|
@ -830,6 +830,13 @@ def read_images(rawdata, colorspace, first_frame_only=False):
|
|
|
|
newimg = imgdata
|
|
|
|
newimg = imgdata
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise ValueError("unknown or unsupported colorspace: %s" % color.name)
|
|
|
|
raise ValueError("unknown or unsupported colorspace: %s" % color.name)
|
|
|
|
|
|
|
|
# the PNG format does not support CMYK, so we fall back to normal
|
|
|
|
|
|
|
|
# compression
|
|
|
|
|
|
|
|
if color in [Colorspace.CMYK, Colorspace["CMYK;I"]]:
|
|
|
|
|
|
|
|
imggz = zlib.compress(newimg.tobytes())
|
|
|
|
|
|
|
|
result.append((color, ndpi, imgformat, imggz, imgwidthpx,
|
|
|
|
|
|
|
|
imgheightpx, []))
|
|
|
|
|
|
|
|
else:
|
|
|
|
# cheapo version to retrieve a PNG encoding of the payload is to
|
|
|
|
# cheapo version to retrieve a PNG encoding of the payload is to
|
|
|
|
# just save it with PIL. In the future this could be replaced by
|
|
|
|
# just save it with PIL. In the future this could be replaced by
|
|
|
|
# dedicated function applying the Paeth PNG filter to the raw pixel
|
|
|
|
# dedicated function applying the Paeth PNG filter to the raw pixel
|
|
|
|