Documentation ¶
Index ¶
- type ImageInfo
- type Transforms
- func (t *Transforms) BimgOptions(imageInfo ImageInfo) ([]bimg.Options, error)
- func (t *Transforms) Blur(sigma, minAmpl float64) error
- func (t *Transforms) Crop(width, height int, gravity string, enlarge, embed bool) error
- func (t *Transforms) Extract(top, left, width, height int) error
- func (t *Transforms) Format(format string) error
- func (t *Transforms) Grayscale()
- func (t *Transforms) Hash() hash.Hash64
- func (t *Transforms) HashStr() string
- func (t *Transforms) Interlace() error
- func (t *Transforms) Merge(other Transforms) error
- func (t *Transforms) Quality(quality int) error
- func (t *Transforms) Resize(width, height int, enlarge bool, preserveAspectRatio bool, fill bool) error
- func (t *Transforms) ResizeCropAuto(width, height int) error
- func (t *Transforms) Rotate(angle int) error
- func (t *Transforms) StripMetadata() error
- func (t *Transforms) ToJSON() map[string]interface{}
- func (t *Transforms) Watermark(image string, position string, opacity float32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageInfo ¶
type ImageInfo struct {
// contains filtered or unexported fields
}
ImageInfo holds information about image
func NewImageInfo ¶
func NewImageInfo(metadata bimg.ImageMetadata, format string) ImageInfo
NewImageInfo create new ImageInfo object from bimg metadata
type Transforms ¶
type Transforms struct { FormatStr string NotEmpty bool NoMerge bool // contains filtered or unexported fields }
Transforms struct hold information about what operations should be performed on image
func Merge ¶ added in v0.12.0
func Merge(transformsTab []Transforms) []Transforms
Merge will merge tab of transformation into single one
func New ¶ added in v0.13.0
func New() Transforms
func (*Transforms) BimgOptions ¶
func (t *Transforms) BimgOptions(imageInfo ImageInfo) ([]bimg.Options, error)
BimgOptions return complete options for bimg lib
func (*Transforms) Blur ¶
func (t *Transforms) Blur(sigma, minAmpl float64) error
Blur blur whole image
func (*Transforms) Crop ¶
func (t *Transforms) Crop(width, height int, gravity string, enlarge, embed bool) error
Crop extract part of image
func (*Transforms) Extract ¶ added in v0.13.0
func (t *Transforms) Extract(top, left, width, height int) error
Extract area from image with given properties
func (*Transforms) Format ¶
func (t *Transforms) Format(format string) error
Format change image format
func (*Transforms) Hash ¶
func (t *Transforms) Hash() hash.Hash64
Hash return unique transform identifier
func (*Transforms) HashStr ¶ added in v0.15.0
func (t *Transforms) HashStr() string
func (*Transforms) Interlace ¶
func (t *Transforms) Interlace() error
Interlace enable image interlace
func (*Transforms) Merge ¶ added in v0.12.0
func (t *Transforms) Merge(other Transforms) error
Merge append transformation from other object
func (*Transforms) Quality ¶
func (t *Transforms) Quality(quality int) error
Quality change image quality
func (*Transforms) Resize ¶
func (t *Transforms) Resize(width, height int, enlarge bool, preserveAspectRatio bool, fill bool) error
Resize change image width and height
func (*Transforms) ResizeCropAuto ¶ added in v0.13.0
func (t *Transforms) ResizeCropAuto(width, height int) error
Crop extract part of image
func (*Transforms) Rotate ¶
func (t *Transforms) Rotate(angle int) error
Rotate rotate image of given angle
func (*Transforms) StripMetadata ¶
func (t *Transforms) StripMetadata() error
StripMetadata remove EXIF from image
func (*Transforms) ToJSON ¶ added in v0.15.0
func (t *Transforms) ToJSON() map[string]interface{}