Documentation ¶
Index ¶
- Constants
- Variables
- func Do(ctx context.Context, img *storage.Image, jobs ...ImageJob) (*storage.Image, error)
- type ImageJob
- func NewAutoOptimImage(quality int, header http.Header) ImageJob
- func NewFillResizeImage(width, height int) ImageJob
- func NewFitResizeImage(width, height int) ImageJob
- func NewGetEntImage(bucket, name string) ImageJob
- func NewGetHTTPImage(url string) ImageJob
- func NewOptimImage(quality int, formats ...string) ImageJob
- func NewWatermark(url string, postion string, angle float64) ImageJob
- func Parse(tasks []string, header http.Header) ([]ImageJob, error)
- type Parser
Constants ¶
View Source
const ( PositionTopLeft = "topLeft" PositionTop = "top" PositionTopRight = "topRight" PositionLeft = "left" PositionCenter = "center" PositionRight = "right" PositionBottomLeft = "bottomLeft" PositionBottom = "bottom" PositionBottomRight = "bottomRight" )
View Source
const ( ImageTypePNG = "png" ImageTypeJPEG = "jpeg" ImageTypeWEBP = "webp" ImageTypeAVIF = "avif" )
Variables ¶
View Source
var ErrAbort = errors.New("abort")
不再执行后续时返回
Functions ¶
Types ¶
type ImageJob ¶
func NewFillResizeImage ¶
func NewFitResizeImage ¶
func NewGetEntImage ¶
func NewGetHTTPImage ¶
func NewOptimImage ¶
Click to show internal directories.
Click to hide internal directories.