We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following program:
package main import ( "bytes" "fmt" "image/gif" ) func main() { data := []byte("GIF89a000\x00000,0\x00\x00\x00\n\x00" + "\n\x00\x80000000\x02\b\xf01u\xb9\xfdal\x05\x00;") img, err := gif.DecodeAll(bytes.NewReader(data)) if err != nil { return } w := new(bytes.Buffer) err = gif.EncodeAll(w, img) if err != nil { panic(err) } img1, err := gif.DecodeAll(w) if err != nil { panic(err) } fmt.Printf("LoopCount: %v -> %v\n", img.LoopCount, img1.LoopCount) }
prints:
LoopCount: 0 -> -1
Image should be preserved after Encode/Decode round trip. A more consistent behavior would be to:
Can't find anything definitive in the GIF spec on this.
go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64
The text was updated successfully, but these errors were encountered:
Well, LoopCount of 0 loops like a reasonable value (don't loop). So I think we need to encode it as 0.
Sorry, something went wrong.
Agreed that it should encode to 0 as a sane default, but FYI a LoopCount of 0 implies that the image should loop infinitely as opposed to not looping at all. (http://www.vurdalakov.net/misc/gif/netscape-looping-application-extension)
Rather simplistic fix proposed here: https://go-review.googlesource.com/#/c/11256/
4bba672
No branches or pull requests
The following program:
prints:
Image should be preserved after Encode/Decode round trip. A more consistent behavior would be to:
Can't find anything definitive in the GIF spec on this.
go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64
The text was updated successfully, but these errors were encountered: