Merge pull request #38 from tschaub/subimage
Start copying at bounds min instead of zero point
This commit is contained in:
commit
a9ff18eccd
5
util.go
5
util.go
@ -54,8 +54,9 @@ func SavePNG(path string, im image.Image) error {
|
||||
}
|
||||
|
||||
func imageToRGBA(src image.Image) *image.RGBA {
|
||||
dst := image.NewRGBA(src.Bounds())
|
||||
draw.Draw(dst, dst.Rect, src, image.ZP, draw.Src)
|
||||
bounds := src.Bounds()
|
||||
dst := image.NewRGBA(bounds)
|
||||
draw.Draw(dst, bounds, src, bounds.Min, draw.Src)
|
||||
return dst
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user