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
Current implementation of reader.go assumes that the number of palette is 256. Therefore, bmp: unsupported BMP image occurs when the number of palette is not 256.
I think that the number of palette should depend on biClrUsed of BITMAPINFOHEADER instead of fixing it to 256. Note that if biClrUsed is 0, the number of palette is 2 to the power of bit per pixel (e.g. 256 colors for 8-bit format, 16 colors for 4-bit format).
I will modify reader.go to support 8-bit format with up to 256 color palette.
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Jul 16, 2023
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I got
bmp: unsupported BMP image
when I tried to Decode the following image.Sample code:
What did you expect to see?
Decode success
What did you see instead?
Additional information
Current implementation of
reader.go
assumes that the number of palette is 256. Therefore,bmp: unsupported BMP image
occurs when the number of palette is not 256.I think that the number of palette should depend on
biClrUsed
ofBITMAPINFOHEADER
instead of fixing it to 256. Note that ifbiClrUsed
is 0, the number of palette is 2 to the power of bit per pixel (e.g. 256 colors for 8-bit format, 16 colors for 4-bit format).I will modify
reader.go
to support 8-bit format with up to 256 color palette.References:
The text was updated successfully, but these errors were encountered: