From 767a5a8b1378367162fbc4edef96dd7762a89205 Mon Sep 17 00:00:00 2001 From: faiface Date: Wed, 1 Mar 2017 12:36:53 +0100 Subject: [PATCH] fix newly introduced bug in PictureDataFromImage --- data.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data.go b/data.go index 5cb1d6d..569f4b6 100644 --- a/data.go +++ b/data.go @@ -161,8 +161,8 @@ func verticalFlip(nrgba *image.NRGBA) { // The resulting PictureData's Bounds will be the equivalent of the supplied image.Image's Bounds. func PictureDataFromImage(img image.Image) PictureData { var nrgba *image.NRGBA - if img, ok := img.(*image.NRGBA); ok { - nrgba = img + if nrgbaImg, ok := img.(*image.NRGBA); ok { + nrgba = nrgbaImg } else { nrgba = image.NewNRGBA(img.Bounds()) draw.Draw(nrgba, nrgba.Bounds(), img, img.Bounds().Min, draw.Src)