image

package
v0.0.0-...-a633465 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUpscaleNotAllowed = errors.New("upscaling is not allowed")
)

Functions

This section is empty.

Types

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image is used for image manipulation

func New

func New(r io.Reader) (image *Image, err error)

New returns image from io.Reader

func NewFromBytes

func NewFromBytes(b []byte) (image *Image, err error)

NewFromBytes returns image from bytes slice

func (*Image) Height

func (i *Image) Height() int

Height return image height

func (*Image) JPEG

func (i *Image) JPEG(quality int) ([]byte, error)

JPEG return image as jpeg

func (*Image) Resize

func (i *Image) Resize(width, height int) error

Resize resize image Warning: upscaling not allowed

func (*Image) ResizeToFit

func (i *Image) ResizeToFit(width, height int) error

ResizeToFit resize image to fit width,height Warning: upscaling not allowed

func (*Image) Width

func (i *Image) Width() int

Width returns image width

Jump to

Keyboard shortcuts

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