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: "invalid pixel value" on image that works in Chrome #8789

Closed
gopherbot opened this issue Sep 22, 2014 · 2 comments
Closed

image/gif: "invalid pixel value" on image that works in Chrome #8789

gopherbot opened this issue Sep 22, 2014 · 2 comments

Comments

@gopherbot
Copy link

by KaneZhangAQ:

Source photo url: http://needkane.qiniudn.com/ret6.gif
But go can't get the gif info .

gifConf, err1 := gif.DecodeAll(imgSource)//if imagesource is the gif
        
        println(err1.Error())//result is gif: invalid pixel value

According to the go source code,I find

if len(m.Palette) < 256 {//get 128
            for _, pixel := range m.Pix {
//pixel is 128 too,but my gif is ok,you can see it from the url
                if int(pixel) >= len(m.Palette) {
                        return errBadPixel
                }
            }
    }
@bradfitz
Copy link
Contributor

Comment 1:

Owner changed to @nigeltao.

Status changed to Accepted.

@nigeltao
Copy link
Contributor

Comment 2:

The GIF spec at http://www.w3.org/Graphics/GIF/spec-gif89a.txt says that "Each index
must be within the range of the size of the active color table". The ret6.gif image
linked to is not a valid GIF image, according to the spec, even if whatever image
library Chrome uses accepts it.
I'm closing this bug as Working As Intended, unless somebody presents some evidence that
at least two different widely-used GIF decoding implementations agree on what to do with
this out-of-spec image.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants