image service: fix cropping + crop example (#170)

This commit is contained in:
Janos Dobronszki
2021-06-23 13:42:51 +01:00
committed by GitHub
parent c4e3a0ee75
commit a7d19bc141
2 changed files with 16 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ func (e *Image) Resize(ctx context.Context, req *img.ResizeRequest, rsp *img.Res
case "bottom right":
anchor = imaging.BottomRight
}
resultImage = imaging.CropAnchor(resultImage, int(req.Width), int(req.Height),
resultImage = imaging.CropAnchor(resultImage, int(req.CropOptions.Width), int(req.CropOptions.Height),
anchor)
}
buf := new(bytes.Buffer)