Version: v0.14.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2019 License: MIT Imports: 8 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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) Grayscale

func (t *Transforms) Grayscale()

Grayscale convert image to B&W

func (*Transforms) Hash

func (t *Transforms) Hash() hash.Hash64

Hash return unique transform identifier

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) 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) Watermark

func (t *Transforms) Watermark(image string, position string, opacity float32) error

Watermark merge two image in one

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL