ekaki

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("unsupported target format")

Functions

func Convert

func Convert(source io.Reader, target Target) (output []byte, err error)

Convert transforms the source image into the target format

Types

type Target

type Target string

Target represents the target format of an image

const (
	TargetBMP  Target = "bmp"
	TargetJPG  Target = "jpg"
	TargetPNG  Target = "png"
	TargetGIF  Target = "gif"
	TargetWebp Target = "webp"
	TargetTiff Target = "tiff"
)

func ImageFrom

func ImageFrom(img io.Reader) (i image.Image, t Target, err error)

ImageFrom reads an image from a reader

func SupportedTargets

func SupportedTargets() []Target

SupportedTargets returns a list of supported target formats

func TargetFromExpr

func TargetFromExpr(expr string) (t Target, err error)

TargetFromExpr returns the target format from a given string

Jump to

Keyboard shortcuts

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