-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/image/bmp: support 4-bit format #58005
Comments
the image link is an expired link |
How shall I share the image pls? this basically the 1st image displayed if you search 'bmp image example' in Google |
upload it here? |
Ok, here we go, I put it into a zip file BMPExample.zip |
The library only supports 8, 24 or 32 bits per pixel https://pkg.go.dev/golang.org/x/image/bmp#DecodeConfig file /tmp/go58005.bmp
/tmp/go58005.bmp: PC bitmap, Windows 3.x format, 640 x 480 x 4 so it fails here https://github.com/golang/image/blob/bb712eb67b2b77b691f7b4335cc013a0eb42b71c/bmp/reader.go#L240 |
Thanks for finding the root cause. Can we add support for 4bpp? sounds like an easy fix? |
Or, do you know any golang image library that can support 4bpp? |
See also related discussion #29711 |
Change https://go.dev/cl/636975 mentions this issue: |
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
Output $ go envGO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/10030"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/10030/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xxx/go/src/yyy/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3498157493=/tmp/go-build -gno-record-gcc-switches"
The text was updated successfully, but these errors were encountered: