Skip to content
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

image/gif: gif: can't recognize format "RIFF\xac\xe4" #65684

Closed
dirslashls opened this issue Feb 12, 2024 · 2 comments
Closed

image/gif: gif: can't recognize format "RIFF\xac\xe4" #65684

dirslashls opened this issue Feb 12, 2024 · 2 comments

Comments

@dirslashls
Copy link

Go version

go version go1.21.6 darwin/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/userxyz/Library/Caches/go-build'
GOENV='/Users/userxyz/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/userxyz/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/userxyz/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK='/Users/userxyz/git/gifti/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/4s/03357nc94kg2j_2nlz7k217c0000gp/T/go-build707805457=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Tried to open the attached gif file using gif.DecodeAll
DogCat

What did you see happen?

It gives the error gif: can't recognize format "RIFF\xac\xe4"

What did you expect to see?

Expecting it to successfully parse the gif.

Please note that this gif opens in all browsers, iMessage and iPhone. Not sure if the gif genuinely has an issue that all these other apps are able to workaround or it is an issue with golang's implementation.

@earthboundkid
Copy link
Contributor

earthboundkid commented Feb 13, 2024

It's not a GIF, it's an animated WebP.

@thanm
Copy link
Contributor

thanm commented Feb 13, 2024

"file" reports

RIFF (little-endian) data, Web/P image

so as @earthboundkid pointed out, this isn't actually a GIF file. Sounds like you need to be using https://pkg.go.dev/golang.org/x/image/webp instead.

Closing, please re-open if you think there is anything to fix here.

@thanm thanm closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants