diff --git a/icon.go b/icon.go index 36c72fc..feb7cb1 100644 --- a/icon.go +++ b/icon.go @@ -42,7 +42,7 @@ func IconNN(img image.Image) IconT { // Resizing to a large icon approximating average color // values of the source image. YCbCr space is used instead // of RGB for better results in image comparison. - resImg, imgSize := resizeByNearest( + resImg, imgSize := ResizeByNearest( img, image.Point{resizedImgSize, resizedImgSize}) largeIcon := sizedIcon(largeIconSize) var r, g, b, sumR, sumG, sumB uint32 diff --git a/image.go b/image.go index d330399..2da8f5b 100644 --- a/image.go +++ b/image.go @@ -24,10 +24,10 @@ func Open(path string) (img image.Image, err error) { return img, err } -// resizeByNearest resizes an image to the destination size +// ResizeByNearest resizes an image to the destination size // with the nearest neighbour method. It also returns the source // image size. -func resizeByNearest( +func ResizeByNearest( src image.Image, dstSize image.Point) ( dst image.RGBA, srcSize image.Point) { // Original image size. diff --git a/image_test.go b/image_test.go index 9e1e46d..b6c9009 100644 --- a/image_test.go +++ b/image_test.go @@ -35,7 +35,7 @@ func TestResizeByNearest(t *testing.T) { if err != nil { t.Error("Cannot decode", path.Join(testDir, table.outFile)) } - resampled, srcSize := resizeByNearest(inImg, + resampled, srcSize := ResizeByNearest(inImg, image.Point{table.dstX, table.dstY}) if !reflect.DeepEqual( outImg.(*image.RGBA), &resampled) ||