images

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedImageType = errors.New("unsupported image type")
	ErrZeroDimensions       = errors.New("image has zero dimensions")
	ErrZeroResize           = errors.New("resize height and width are both zero")
)

Functions

func ResizeImage

func ResizeImage(ext string, input io.Reader, height uint, width uint) ([]byte, error)

Types

type ImageType

type ImageType interface {
	Decode(input io.Reader) (image.Image, error)
	Encode(w io.Writer, m image.Image) error
}

type JPEG

type JPEG struct {
	ImageType
}

func (JPEG) Decode

func (g JPEG) Decode(input io.Reader) (image.Image, error)

func (JPEG) Encode

func (g JPEG) Encode(w io.Writer, m image.Image) error

type PNG

type PNG struct {
	ImageType
}

func (PNG) Decode

func (g PNG) Decode(input io.Reader) (image.Image, error)

func (PNG) Encode

func (g PNG) Encode(w io.Writer, m image.Image) error

type ResizeTypeFn

type ResizeTypeFn = func(input io.Reader, height uint, width uint) ([]byte, error)

Jump to

Keyboard shortcuts

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