Documentation ¶
Index ¶
- type ConfigImage
- type Image
- func (img *Image) CheckSize(maxSize kk_file.FileSize) (support bool)
- func (img *Image) Copy() *Image
- func (img *Image) GetResizedImage() (uploadDataReader *bytes.Reader, err error)
- func (img *Image) Resize() ([]byte, error)
- func (img *Image) SetTargetSizeType(targetSize TargetSize, targetType kk_file.FileType) *Image
- type TargetSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigImage ¶
func (*ConfigImage) Close ¶
func (c *ConfigImage) Close()
func (*ConfigImage) Init ¶
func (c *ConfigImage) Init()
type Image ¶
type Image struct { TargetSize TargetSize TargetType kk_file.FileType SourceType kk_file.FileType // contains filtered or unexported fields }
func NewImageFromBuffer ¶
func NewImageFromFileHeader ¶
func NewImageFromFileHeader(fileHeader multipart.FileHeader) (img *Image, err error)
func (*Image) GetResizedImage ¶
GetResizedImage 获取压缩后用于上传的图片数据
func (*Image) SetTargetSizeType ¶
func (img *Image) SetTargetSizeType(targetSize TargetSize, targetType kk_file.FileType) *Image
type TargetSize ¶
type TargetSize string
const ( Small TargetSize = "small" Medium TargetSize = "medium" Original TargetSize = "original" )
func (TargetSize) String ¶
func (ts TargetSize) String() string
Click to show internal directories.
Click to hide internal directories.