Skip to content

Commit a9ff18e

Browse files
authored
Merge pull request #38 from tschaub/subimage
Start copying at bounds min instead of zero point
2 parents c97f757 + ca366ba commit a9ff18e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

util.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ func SavePNG(path string, im image.Image) error {
5454
}
5555

5656
func imageToRGBA(src image.Image) *image.RGBA {
57-
dst := image.NewRGBA(src.Bounds())
58-
draw.Draw(dst, dst.Rect, src, image.ZP, draw.Src)
57+
bounds := src.Bounds()
58+
dst := image.NewRGBA(bounds)
59+
draw.Draw(dst, bounds, src, bounds.Min, draw.Src)
5960
return dst
6061
}
6162

0 commit comments

Comments
 (0)