imagik

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RotateSquare    = 0
	RotatePortrait  = 1
	RotateLandscape = 2
)
View Source
const MaxTimeout = 10

Variables

This section is empty.

Functions

func UrlGrabber

func UrlGrabber(url string, headers map[string]string, b *[]byte, mimeType *string, timeout int) error

Types

type Imagik

type Imagik struct {
	Img      image.Image
	MimeType string
	Size     int
}

func NewImagikFromByte added in v2.0.10

func NewImagikFromByte(b []byte) (*Imagik, error)

func NewImagikFromFile added in v2.0.10

func NewImagikFromFile(filename string) (*Imagik, error)

func NewImagikFromUrl added in v2.0.10

func NewImagikFromUrl(url string, headers map[string]string) (*Imagik, error)

func (*Imagik) Bounds

func (img *Imagik) Bounds() image.Rectangle

func (*Imagik) Crop

func (img *Imagik) Crop(rect image.Rectangle)

func (*Imagik) CropCenter

func (img *Imagik) CropCenter(w int, h int)

func (*Imagik) ExportAsByte

func (img *Imagik) ExportAsByte() ([]byte, error)

func (*Imagik) ExportAsByteWithQuality added in v2.0.10

func (img *Imagik) ExportAsByteWithQuality(q int) ([]byte, error)

func (*Imagik) ExportAsDataUrl

func (img *Imagik) ExportAsDataUrl() (string, error)

func (*Imagik) ExportAsFile

func (img *Imagik) ExportAsFile(filename string) error

func (*Imagik) ExportAsFileWithQuality added in v2.0.10

func (img *Imagik) ExportAsFileWithQuality(filename string, q int) error

func (*Imagik) ExportAsPNGByte

func (img *Imagik) ExportAsPNGByte() ([]byte, error)

func (*Imagik) ExportAsPNGByteWithCompLevel

func (img *Imagik) ExportAsPNGByteWithCompLevel(compLevel png.CompressionLevel) ([]byte, error)

func (*Imagik) ExportAsPNGDataUrl

func (img *Imagik) ExportAsPNGDataUrl() (string, error)

func (*Imagik) ExportAsPNGFile

func (img *Imagik) ExportAsPNGFile(filename string) error

func (*Imagik) IsSquare

func (img *Imagik) IsSquare() bool

func (*Imagik) LoadFromByte

func (img *Imagik) LoadFromByte(b []byte) error

func (*Imagik) LoadFromFile

func (img *Imagik) LoadFromFile(filename string) error

func (*Imagik) LoadFromUrl

func (img *Imagik) LoadFromUrl(url string, headers map[string]string) error

func (*Imagik) Resize

func (img *Imagik) Resize(w int, h int)

func (*Imagik) ResizeWithFilter added in v2.0.10

func (img *Imagik) ResizeWithFilter(w int, h int, filter imaging.ResampleFilter)

func (*Imagik) Rotation

func (img *Imagik) Rotation() int

func (*Imagik) SquareThumbnailAsPNGByte

func (img *Imagik) SquareThumbnailAsPNGByte(size int) ([]byte, error)

func (*Imagik) ThumbnailAsByte

func (img *Imagik) ThumbnailAsByte(w int, h int) ([]byte, error)

func (*Imagik) ThumbnailAsFile

func (img *Imagik) ThumbnailAsFile(filename string, w int, h int) error

Jump to

Keyboard shortcuts

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