img

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = stdError.New("File not supported")

ErrNotSupported returned by Parse when given file is not in a supported format

Functions

func Apply added in v0.18.0

func Apply(input []byte, operations ...ImageOperation) ([]byte, error)

Apply a list of operations on a given image

Types

type File

type File struct {
	Width  int
	Height int
	Size   int
}

File is an image supported by Fider

func Parse

func Parse(file []byte) (*File, error)

Parse returns the a img.File if it's supported by fider

type ImageOperation added in v0.18.0

type ImageOperation func(image.Image, string) image.Image

ImageOperation is an operation that can be performed on an image and retun a modified version of it

func ChangeBackground added in v0.18.0

func ChangeBackground(bgColor color.Color) ImageOperation

ChangeBackground will change given image transparent background to given color

func Padding added in v0.18.0

func Padding(padding int) ImageOperation

Padding adds a padding based on given value

func Resize

func Resize(size int) ImageOperation

Resize image based on given size

Jump to

Keyboard shortcuts

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