ximage

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package ximage provider higher level functions for image processing

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedImageType = fmt.Errorf("unsupported image type")

ErrUnsupportedImageType is an error when unsupported ImageType passed

Functions

func Crop

func Crop(src io.Reader, dst io.Writer, t ImageType, x0, y0, x1, y1 int) error

Crop crops the source image and write the cropped image to dst.

func Decode

func Decode(src io.Reader, t ImageType) (image.Image, error)

Decode decodes the image

Types

type ImageType

type ImageType string

ImageType is a type string of an image

const (
	ImageTypeUnknown ImageType = "unknown"
	ImageTypePNG     ImageType = "png"
	ImageTypeJPEG    ImageType = "jpeg"
)

Available ImageType values

func TypeByExtension

func TypeByExtension(ext string) ImageType

TypeByExtension returns ImageType by extention

Jump to

Keyboard shortcuts

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