Skip to content

image/gif: result of EncodeAll not viewable in Eye of GNOME #13746

@pierrre

Description

@pierrre

Go version: 1.5.2 & 1.6beta1 linux/amd64
Architecture: Linux pierre-vm 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux

With this image: https://raw.githubusercontent.com/pierrre/imageserver/master/testdata/animated.gif
Run:

package main

import (
    "bytes"
    "image/gif"
    "io/ioutil"
)

func main() {
    b, err := ioutil.ReadFile("/home/pierre/Go/src/github.com/pierrre/imageserver/testdata/animated.gif")
    if err != nil {
        panic(err)
    }
    g, err := gif.DecodeAll(bytes.NewReader(b))
    if err != nil {
        panic(err)
    }
    buf := new(bytes.Buffer)
    err = gif.EncodeAll(buf, g)
    if err != nil {
        panic(err)
    }
    b = buf.Bytes()
    err = ioutil.WriteFile("test.gif", b, 0644)
    if err != nil {
        panic(err)
    }
}

If I open the encoded image (test.gif) with Eye of GNOME 3.18.1 (default image viewer on Gnome), I get an error message: "Circular table entry in GIF file".

I can open the original image with Eye of GNOME.
I can open the encoded image with Firefox, Chrome, or XnView.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions