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
There are images which browsers can render but which image/gif chokes on.
The following runs successfully for most gifs:
import (
"fmt""image/gif""os"
)
constexample="sample.gif"funcmain() {
fmt.Println("attempting to read gif")
file, err:=os.Open(example)
iferr!=nil {
fmt.Println("Can't open this file:", err)
return
}
img, err:=gif.Decode(file)
iferr!=nil {
fmt.Println("Can't decode this as a gif:", err)
return
}
_=img.Bounds()
fmt.Println("gif decoded")
}
But when trying to run it on a particular gif (below), this happens:
$ go run main.go
attempting to read gif
Can't decode this as a gif: gif: not enough image data
Here’s the offending gif:
Meanwhile, when I run this on another (similar) gif, I get the following:
$ go run main.go
attempting to read gif
Can't decode this as a gif: gif: too much image data
It seems like something might be wrong with these gifs, but browsers are still able to read them, so it seems that image/gif should be able to as well.
Tested with both 1.3 and 1.4.
The text was updated successfully, but these errors were encountered:
There are images which browsers can render but which image/gif chokes on.
The following runs successfully for most gifs:
But when trying to run it on a particular gif (below), this happens:
Here’s the offending gif:
Meanwhile, when I run this on another (similar) gif, I get the following:
It seems like something might be wrong with these gifs, but browsers are still able to read them, so it seems that image/gif should be able to as well.
Tested with both 1.3 and 1.4.
The text was updated successfully, but these errors were encountered: