From 301cec7b07362fd7febad29142307d34f560b502 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 3 Mar 2017 18:39:14 +1300 Subject: [PATCH] gopngquant: fix issue with non-square input images --- cmd/gopngquant/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gopngquant/main.go b/cmd/gopngquant/main.go index 5cc74ca..cbfa94a 100644 --- a/cmd/gopngquant/main.go +++ b/cmd/gopngquant/main.go @@ -61,7 +61,7 @@ func Rgb8PaletteToGoImage(w, h int, rgb8data []byte, pal color.Palette) image.Im for y := 0; y < h; y += 1 { for x := 0; x < w; x += 1 { - ret.SetColorIndex(x, y, rgb8data[y*h+x]) + ret.SetColorIndex(x, y, rgb8data[y*w+x]) } }