Documentation ¶
Index ¶
- Variables
- func HashEncode(bytes []byte) string
- type AspectRatio
- type Image
- func (img *Image) AR(ar AspectRatio) (width, height int)
- func (img *Image) ARMaxSize(ar AspectRatio, maxPx int) (width, height int)
- func (img *Image) BlobToImg(blob []byte) (err error)
- func (img *Image) Close()
- func (img *Image) Crop(width, height int) error
- func (img *Image) CropAR(ar AspectRatio) error
- func (img *Image) Export() ([]byte, error)
- func (img *Image) Fix()
- func (img *Image) GetFormat() fileutil.Format
- func (img *Image) Pages() (pages int)
- func (img *Image) Resize(width, height int) error
- func (img *Image) Thumbnail(width, height int) error
- func (img *Image) ThumbnailAR(ar AspectRatio) error
- func (img *Image) WH() (width, height int)
- func (img *Image) WriteToPath(imagePath string) error
- type ImageOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadType = errors.New("imagedit: Error bad file type") ErrNilOutput = errors.New("imagedit: Error nil output") )
Functions ¶
func HashEncode ¶
Types ¶
type AspectRatio ¶
type AspectRatio int
const ( // Use Image AspectRatio AR_Image AspectRatio = iota // 1:1 square AR_1x1 // 5:4 AR_5x4 // 4:3 AR_4x3 // 3:2 AR_3x2 // 16:10 AR_16x10 // 16:9 AR_16x9 // 3:1 AR_3x1 )
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func MPHtoImg ¶
func MPHtoImg(fileHead *multipart.FileHeader) (img *Image, b58hash string, err error)
func NewFromBlob ¶
func NewFromPath ¶
func (*Image) AR ¶
func (img *Image) AR(ar AspectRatio) (width, height int)
func (*Image) ARMaxSize ¶
func (img *Image) ARMaxSize(ar AspectRatio, maxPx int) (width, height int)
func (*Image) CropAR ¶
func (img *Image) CropAR(ar AspectRatio) error
CropAR crops image using aspect ratio
func (*Image) ThumbnailAR ¶
func (img *Image) ThumbnailAR(ar AspectRatio) error
ThumbnailAR resizes and crops image using aspect ratio
func (*Image) WriteToPath ¶
type ImageOptions ¶
Click to show internal directories.
Click to hide internal directories.