Documentation ¶
Index ¶
- func GetGoodResize(ow, oh, w, h int) (int, int, int, int)
- type ImageTransform
- func (t *ImageTransform) Buffer() (*bytes.Buffer, error)
- func (t *ImageTransform) Crop(x, y, w, h int) *ImageTransform
- func (t *ImageTransform) Crop4(crop []int) *ImageTransform
- func (t *ImageTransform) CropRect(rect image.Rectangle) *ImageTransform
- func (t *ImageTransform) ImClone() *ImageTransform
- func (t *ImageTransform) Resize(w, h int) *ImageTransform
- func (t *ImageTransform) ResizeKeepRatio(w, h int) *ImageTransform
- func (t *ImageTransform) ResizeMax(maxWidth, maxHeight int) bool
- func (t *ImageTransform) Save(filePath string) error
- func (t *ImageTransform) Size() (int, int)
- func (t *ImageTransform) Write(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageTransform ¶
func NewImageFileTransform ¶
func NewImageFileTransform(filename string) (*ImageTransform, error)
func NewImageTransform ¶
func NewImageTransformExt ¶
func NewImageTransformExt(file io.Reader, ext string) (*ImageTransform, error)
func (*ImageTransform) Crop ¶
func (t *ImageTransform) Crop(x, y, w, h int) *ImageTransform
func (*ImageTransform) Crop4 ¶
func (t *ImageTransform) Crop4(crop []int) *ImageTransform
Crop4 crop x, y, w, h
func (*ImageTransform) CropRect ¶
func (t *ImageTransform) CropRect(rect image.Rectangle) *ImageTransform
func (*ImageTransform) ImClone ¶
func (t *ImageTransform) ImClone() *ImageTransform
func (*ImageTransform) Resize ¶
func (t *ImageTransform) Resize(w, h int) *ImageTransform
func (*ImageTransform) ResizeKeepRatio ¶
func (t *ImageTransform) ResizeKeepRatio(w, h int) *ImageTransform
func (*ImageTransform) ResizeMax ¶
func (t *ImageTransform) ResizeMax(maxWidth, maxHeight int) bool
ResizeMax 不改变压缩比,选择最大的压缩比
func (*ImageTransform) Save ¶
func (t *ImageTransform) Save(filePath string) error
func (*ImageTransform) Size ¶
func (t *ImageTransform) Size() (int, int)
func (*ImageTransform) Write ¶
func (t *ImageTransform) Write(filename string) error
Click to show internal directories.
Click to hide internal directories.