We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb74d35 commit eabfc26Copy full SHA for eabfc26
lib/matplotlib/backends/backend_pdf.py
@@ -1529,7 +1529,8 @@ def _writePng(self, img):
1529
buffer = BytesIO()
1530
img.save(buffer, format="png")
1531
buffer.seek(8)
1532
- png_data = bit_depth = palette = None
+ png_data = b''
1533
+ bit_depth = palette = None
1534
while True:
1535
length, type = struct.unpack(b'!L4s', buffer.read(8))
1536
if type in [b'IHDR', b'PLTE', b'IDAT']:
@@ -1541,7 +1542,7 @@ def _writePng(self, img):
1541
1542
elif type == b'PLTE':
1543
palette = data
1544
elif type == b'IDAT':
- png_data = data
1545
+ png_data += data
1546
elif type == b'IEND':
1547
break
1548
else:
0 commit comments