transforms

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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) 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) 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{}

func (*Transforms) Watermark

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

Watermark merge two image in one

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL