|
|
@ -589,6 +589,15 @@ def test_suite():
|
|
|
|
# to the pixel data of the input image
|
|
|
|
# to the pixel data of the input image
|
|
|
|
imgdata = zlib.decompress(
|
|
|
|
imgdata = zlib.decompress(
|
|
|
|
convert_store(cur_page.Resources.XObject.Im0.stream))
|
|
|
|
convert_store(cur_page.Resources.XObject.Im0.stream))
|
|
|
|
|
|
|
|
if imgprops.DecodeParms:
|
|
|
|
|
|
|
|
if orig_img.format == 'PNG':
|
|
|
|
|
|
|
|
pngidat, palette = img2pdf.parse_png(orig_imgdata)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
pngbuffer = BytesIO()
|
|
|
|
|
|
|
|
orig_img.save(pngbuffer, format="png")
|
|
|
|
|
|
|
|
pngidat, palette = img2pdf.parse_png(pngbuffer.getvalue())
|
|
|
|
|
|
|
|
self.assertEqual(zlib.decompress(pngidat), imgdata)
|
|
|
|
|
|
|
|
else:
|
|
|
|
colorspace = imgprops.ColorSpace
|
|
|
|
colorspace = imgprops.ColorSpace
|
|
|
|
if colorspace == PdfName.DeviceGray:
|
|
|
|
if colorspace == PdfName.DeviceGray:
|
|
|
|
colorspace = 'L'
|
|
|
|
colorspace = 'L'
|
|
|
|