• Nigel Tao's avatar
    image/gif: don't assume Encode src's origin is (0, 0) · 4dad64f5
    Nigel Tao authored
    When gif.Encode is given an "m image.Image" argument that isn't an
    *image.Paletted, it creates a temporary *image.Paletted (called pm) that
    is intended to be a copy of this image, only with fewer colors.
    
    That creation process, and specifically the opts.Drawer.Draw call that
    does the copy, incorrectly assumed that m.Bounds().Min is the zero point
    (0, 0). This commit fixes that.
    
    Fixes #30887
    
    Change-Id: Ie03bddec359e2dcc52f18451049452105514e179
    Reviewed-on: https://go-review.googlesource.com/c/go/+/168418
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarRob Pike <r@golang.org>
    4dad64f5
writer.go 11.7 KB