Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResizedPhotoURL ¶
func GetResizedPhotoURL(pic *client.Photo, rOptions ResizeOptions) string
GetResizedPhotoURL takes a picture and a ResizeOptions object, dynamically resizes Photo.URLs.Raw using the options and returns the resulting URL
Types ¶
type ResizeOptions ¶
type ResizeOptions struct { Width string Height string Crop string // https://docs.imgix.com/apis/rendering/size/crop ImageFormat string // https://docs.imgix.com/apis/rendering/format/fm Auto string // https://docs.imgix.com/apis/rendering/auto/auto Quality string //for changing the compression quality when using lossy file formats // https://docs.imgix.com/apis/rendering/format/q Fit string // for changing the fit of the image within the specified dimensions // https://docs.imgix.com/apis/rendering/size/fit DevicePixelRatio string // min-value is 1, max-value is 5 }
ResizeOptions defines parameters that resize a photo Resizing is done using Imgix()
func NewDefaultResizeOptions ¶
func NewDefaultResizeOptions(w, h int) *ResizeOptions
NewDefaultResizeOptions takes in width and height to return a new default ResizeOptions with custom dimensions
func (ResizeOptions) String ¶
func (rOptions ResizeOptions) String() string
Click to show internal directories.
Click to hide internal directories.