Documentation ¶
Index ¶
- Constants
- type CropGravity
- type CropParam
- type FormatParam
- type Image
- func (image *Image) Crop(param *CropParam) *Image
- func (image *Image) Format(param *FormatParam) *Image
- func (image *Image) Info() *Image
- func (image *Image) Process() (*service.ImageProcessOutput, error)
- func (image *Image) Resize(param *ResizeParam) *Image
- func (image *Image) Rotate(param *RotateParam) *Image
- func (image *Image) WaterMark(param *WaterMarkParam) *Image
- func (image *Image) WaterMarkImage(param *WaterMarkImageParam) *Image
- type ResizeMode
- type ResizeParam
- type RotateParam
- type WaterMarkImageParam
- type WaterMarkParam
Constants ¶
View Source
const ( // ActionSep is separator of action. ActionSep = ":" // OPSep is separator of operation. OPSep = "|" // KVSep is separator of Key-Value. KVSep = "_" //KVPairSep is separator of args. KVPairSep = "," )
View Source
const ( // InfoOperation is string of info operation. InfoOperation string = "info" // CropOperation is string of crop operation. CropOperation string = "crop" // FormatOperation is string of format operation. FormatOperation string = "format" // ResizeOperation is string of resize operation. ResizeOperation string = "resize" // RotateOperation is string of rotate operation. RotateOperation string = "rotate" // WaterMarkOperation is string of watermark operation. WaterMarkOperation string = "watermark" // WaterMarkImageOperation is string of watermark image operation. WaterMarkImageOperation string = "watermark_image" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CropGravity ¶
type CropGravity int
CropGravity is the type of crop gravity.
const ( // CropCenter crops image to center width and height. CropCenter CropGravity = iota // CropNorth crops image to north width and height. CropNorth // CropEast crops image to east width and height. CropEast // CropSouth crops image to south width and height. CropSouth // CropWest crops image to west width and height. CropWest // CropNorthWest crops image to north west width and height. CropNorthWest // CropNorthEast crops image to north east width and height. CropNorthEast // CropSouthWest crops image to south west width and height. CropSouthWest // CropSouthEast crops image to south east width and height. CropSouthEast // CropAuto crops image to auto width and height. CropAuto )
type CropParam ¶
type CropParam struct { Width int `schema:"w,omitempty"` Height int `schema:"h,omitempty"` Gravity CropGravity `schema:"g"` }
CropParam is param of the crop operation.
type FormatParam ¶
type FormatParam struct {
Type string `schema:"t"`
}
FormatParam is param of the format operation.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is struct of Image process.
func (*Image) Process ¶
func (image *Image) Process() (*service.ImageProcessOutput, error)
Process does Image process.
func (*Image) WaterMark ¶
func (image *Image) WaterMark(param *WaterMarkParam) *Image
WaterMark is operation of watermark text content.
func (*Image) WaterMarkImage ¶
func (image *Image) WaterMarkImage(param *WaterMarkImageParam) *Image
WaterMarkImage is operation of watermark image.
type ResizeMode ¶
type ResizeMode int
ResizeMode is the type of resize mode.
const ( // ResizeFixed resizes image to fix width and height. ResizeFixed ResizeMode = iota // ResizeForce resizes image to force witdth and height. ResizeForce // ResizeThumbnail resizes image to thumbnail width and height. ResizeThumbnail )
type ResizeParam ¶
type ResizeParam struct { Width int `schema:"w,omitempty"` Height int `schema:"h,omitempty"` Mode ResizeMode `schema:"m"` }
ResizeParam is param of the resize operation.
type RotateParam ¶
type RotateParam struct {
Angle int `schema:"a"`
}
RotateParam is param of the rotate operation.
Click to show internal directories.
Click to hide internal directories.