Skip to content

Commit

Permalink
Merge pull request #38 from tschaub/subimage
Browse files Browse the repository at this point in the history
Start copying at bounds min instead of zero point
  • Loading branch information
fogleman authored Mar 16, 2018
2 parents c97f757 + ca366ba commit a9ff18e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a9ff18e

Please sign in to comment.