Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
image/gif: bounds offset reversed when encoding #30887
go 1.12.1 linux/amd64
What did you expect to see?
image shift not depending on saved format.
What did you see instead?
gif image shifted in the opposite direction to all other formats.
(several other image format generating libs tried and gif the only one in disagreement.)
without shift:all white, all the same as expected
(png image above not showing in github md?)
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 <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Rob Pike <firstname.lastname@example.org>