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 3a62483 commit 0aed0e9Copy full SHA for 0aed0e9
adafruit_imageload/png.py
@@ -61,10 +61,6 @@ def load(
61
height = 0
62
while True:
63
size, chunk = struct.unpack(">I4s", file.read(8))
64
- print("==================")
65
- print(size)
66
- print(chunk)
67
- print('====================')
68
if chunk == b"IHDR":
69
(
70
width,
@@ -91,8 +87,10 @@ def load(
91
87
for i in range(pal_size):
92
88
pal[i] = file.read(3)
93
89
elif chunk == b"tRNS":
94
- transparent = file.read(size)
95
- print(transparent)
90
+ trns_list = list(file.read(size))
+ indices = [i for i, x in enumerate(trns_list) if x == 0]
+ for index in indices:
+ pal.make_transparent(index)
96
elif chunk == b"IDAT":
97
data.extend(file.read(size))
98
elif chunk == b"IEND":
0 commit comments