gothumb

package module
v0.0.0-...-9a6db75 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 14 Imported by: 1

README

gothumb

Go thumbnail generator.

GoDoc

Install

go get github.com/koofr/gothumb

Dependencies

Gothumb depends on goepeg which depends on epeg C library. Please look at goepeg's install instructions.

https://github.com/koofr/goepeg

Install

go get github.com/koofr/goepeg

Testing

go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanTransform

func CanTransform(orientation int) (ok bool)

func EpegThumbnail

func EpegThumbnail(input string, output string, size int, quality int, scaleType goepeg.ScaleType) (err error)

func FlipH

func FlipH(s image.Image) (image.Image, error)

func FlipV

func FlipV(s image.Image) (image.Image, error)

func GenericThumbnail

func GenericThumbnail(input string, output string, size int, quality int, scaleType goepeg.ScaleType) (err error)

func Orientation

func Orientation(reader io.Reader) (orientation int, err error)

func Rotate

func Rotate(s image.Image, deg int) (image.Image, error)

func Thumbnail

func Thumbnail(in io.Reader, size int, quality int, scaleType goepeg.ScaleType) (out io.ReadCloser, err error)

func Transform

func Transform(orientation int, transformer Transformer) error

func Transpose

func Transpose(s image.Image) (image.Image, error)

func Transverse

func Transverse(s image.Image) (image.Image, error)

Types

type EpegTransformer

type EpegTransformer struct {
	In  string
	Out string
}

func NewEpegTransformer

func NewEpegTransformer(input string, output string) *EpegTransformer

func (EpegTransformer) FlipH

func (t EpegTransformer) FlipH() error

func (EpegTransformer) FlipV

func (t EpegTransformer) FlipV() error

func (EpegTransformer) None

func (t EpegTransformer) None() error

func (EpegTransformer) Rotate180

func (t EpegTransformer) Rotate180() error

func (EpegTransformer) Rotate270

func (t EpegTransformer) Rotate270() error

func (EpegTransformer) Rotate90

func (t EpegTransformer) Rotate90() error

func (EpegTransformer) Transpose

func (t EpegTransformer) Transpose() error

func (EpegTransformer) Transverse

func (t EpegTransformer) Transverse() error

type GenericTransformer

type GenericTransformer struct {
	In  image.Image
	Out image.Image
}

func (GenericTransformer) FlipH

func (t GenericTransformer) FlipH() error

func (GenericTransformer) FlipV

func (t GenericTransformer) FlipV() error

func (GenericTransformer) None

func (t GenericTransformer) None() error

func (GenericTransformer) Rotate180

func (t GenericTransformer) Rotate180() error

func (GenericTransformer) Rotate270

func (t GenericTransformer) Rotate270() error

func (GenericTransformer) Rotate90

func (t GenericTransformer) Rotate90() error

func (GenericTransformer) Transpose

func (t GenericTransformer) Transpose() error

func (GenericTransformer) Transverse

func (t GenericTransformer) Transverse() error

type Transformer

type Transformer interface {
	None() error
	FlipH() error
	FlipV() error
	Transpose() error
	Rotate90() error
	Rotate180() error
	Rotate270() error
	Transverse() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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