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've been playing with the latest version of go-thumbhash. I've found one specific image that makes the library panic. This image is a gif, we can't reproduce this consistenly as this library was able to process other gifs. Does this library supports gifs? It is unclear from the readme which image types are supported.
Minimal repro
$ go run . ~/Downloads/blob.gif
panic: runtime error: index out of range [889171] with length 889168
goroutine 1 [running]:
github.com/galdor/go-thumbhash.EncodeImage({0x10463d5f8, 0x1400007e240})
/Users/aymericbeaumet/go/pkg/mod/github.com/galdor/[email protected]/thumbhash.go:36 +0x61c
main.main()
/Users/aymericbeaumet/Workspace/aymericbeaumet/thumbhash-panic/main.go:25 +0x68
exit status 2
package main
import (
"image"
_ "image/gif" // add gif support
_ "image/jpeg" // add jpeg support
_ "image/png" // add png support
"os"
"github.com/galdor/go-thumbhash"
)
func main() {
reader, err := os.Open(os.Args[1])
if err != nil {
panic(err)
}
var img image.Image
img, _, err = image.Decode(reader)
if err != nil {
panic(err)
}
_ = thumbhash.EncodeImage(img) // panics
}
The text was updated successfully, but these errors were encountered:
aymericbeaumet
changed the title
Panic when passing a specific gif to thumbhash
Panic when passing a specific gif
Apr 9, 2024
Using the latest master fixed the issue (command below) thank you! Would you recommend using master instead of v1.0.0, if so would this justify bumping a minor version?
go get github.com/galdor/go-thumbhash@5f40e920ff450b03da9e7a9875a452806fa89fe0
I've been playing with the latest version of go-thumbhash. I've found one specific image that makes the library panic. This image is a gif, we can't reproduce this consistenly as this library was able to process other gifs. Does this library supports gifs? It is unclear from the readme which image types are supported.
Minimal repro
The text was updated successfully, but these errors were encountered: