Skip to content

Commit

Permalink
Add image height and width option to Go SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Jan 14, 2025
1 parent 489cb45 commit fd681ed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ func (o *TakeOptions) ImageQuality(imageQuality int) *TakeOptions {
return o
}

// ImageHeight sets the height of the resulting image (pixels).
func (o *TakeOptions) ImageHeight(imageHeight int) *TakeOptions {
o.query.Add("image_height", strconv.Itoa(imageHeight))

return o
}

// ImageWidth sets the width of the resulting image (pixels).
func (o *TakeOptions) ImageWidth(imageWidth int) *TakeOptions {
o.query.Add("image_width", strconv.Itoa(imageWidth))

return o
}

// OmitBackground renders a transparent background for the image. Works only if the site has not defined background color.
// Available for the following response formats: "png", "webp".
func (o *TakeOptions) OmitBackground(omitBackground bool) *TakeOptions {
Expand Down

0 comments on commit fd681ed

Please sign in to comment.