You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. include bit_per_component(actually self.header.bit_depth) in calculation.
(I suggest renaming pixel_len to component_count, but it's also a little weird: paletted images can have more than 1 component, so maybe a better name?)
For pal2/pal4 images, it failed to convert index to pixel.
Hi, thanks for all this fixes, I have not actually tested it on these types of images.
I'm OK with you about the pixel_len name. I suggest using the name used in the PNG specification (I don't know it).
I will be happy to accept your PR.
I tried
png-parser
withpal2
/pal4
/rgb48
images:... and they all fail. There are mainly 3 problems.
For all images,
scanline_width
is incorrect, so each scanline read is either too short or too long.png-parser/pngparser/imagedata.py
Lines 232 to 234 in 4d75f17
Guess it should be like:
i.e. include
bit_per_component
(actuallyself.header.bit_depth
) in calculation.(I suggest renaming
pixel_len
tocomponent_count
, but it's also a little weird: paletted images can have more than 1 component, so maybe a better name?)For
pal2
/pal4
images, it failed to convert index to pixel.png-parser/pngparser/imagedata.py
Lines 332 to 333 in 4d75f17
The correct way is:
For
rgb48
images, it failed to scale pixel value to 0~255 range when displaying.png-parser/pngparser/imagedata.py
Lines 337 to 341 in 4d75f17
With
rgb48
,bit_depth
is 16, i.e.val in range(0, 65536)
.So
val
should be divided by 256, or be shifted 8 bits to the right:I can craft a PR for these issues, but I'm not sure about the wording problem. Anyone has an idea?
The text was updated successfully, but these errors were encountered: