Documentation ¶
Index ¶
- Variables
- func ImageSize(e image.Image) (int, int)
- type Engine
- type GoImageEngine
- func (e *GoImageEngine) Fit(img *imagefile.ImageFile, width int, height int, options *Options) ([]byte, error)
- func (e *GoImageEngine) Flip(img *imagefile.ImageFile, pos string, options *Options) ([]byte, error)
- func (e *GoImageEngine) Resize(img *imagefile.ImageFile, width int, height int, options *Options) ([]byte, error)
- func (e *GoImageEngine) Rotate(img *imagefile.ImageFile, deg int, options *Options) ([]byte, error)
- func (e *GoImageEngine) Scale(img image.Image, dstWidth int, dstHeight int, upscale bool, ...) *image.NRGBA
- func (e *GoImageEngine) Source(img *imagefile.ImageFile) (image.Image, error)
- func (e *GoImageEngine) Thumbnail(img *imagefile.ImageFile, width int, height int, options *Options) ([]byte, error)
- func (e *GoImageEngine) ToBytes(img image.Image, format imaging.Format, quality int) ([]byte, error)
- func (e *GoImageEngine) Transform(img *imagefile.ImageFile, operation *Operation, qs map[string]string) (*imagefile.ImageFile, error)
- func (e *GoImageEngine) TransformGIF(img *imagefile.ImageFile, width int, height int, options *Options, ...) ([]byte, error)
- type ImageTransformation
- type Operation
- type Options
- type Result
- type Transformation
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentTypes = map[string]string{
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"png": "image/png",
"bmp": "image/bmp",
"gif": "image/gif",
}
View Source
var Fit = &Operation{
"fit",
}
View Source
var Flip = &Operation{
"flip",
}
View Source
var FlipTransformations = map[string]ImageTransformation{ "h": imaging.FlipH, "v": imaging.FlipV, }
View Source
var Formats = map[string]imaging.Format{ "jpeg": imaging.JPEG, "jpg": imaging.JPEG, "png": imaging.PNG, "gif": imaging.GIF, "bmp": imaging.BMP, }
View Source
var Operations = map[string]*Operation{ Resize.Name: Resize, Thumbnail.Name: Thumbnail, Flip.Name: Flip, Rotate.Name: Rotate, Fit.Name: Fit, }
View Source
var Resize = &Operation{
"resize",
}
View Source
var Rotate = &Operation{
"rotate",
}
View Source
var RotateTransformations = map[int]ImageTransformation{ 90: imaging.Rotate90, 270: imaging.Rotate270, 180: imaging.Rotate180, }
View Source
var Thumbnail = &Operation{
"thumbnail",
}
Functions ¶
Types ¶
type Engine ¶
type Engine interface { Resize(img *image.ImageFile, width int, height int, options *Options) ([]byte, error) Thumbnail(img *image.ImageFile, width int, height int, options *Options) ([]byte, error) Transform(img *image.ImageFile, operation *Operation, qs map[string]string) (*image.ImageFile, error) Flip(img *image.ImageFile, pos string, options *Options) ([]byte, error) Rotate(img *image.ImageFile, deg int, options *Options) ([]byte, error) Fit(img *image.ImageFile, width int, height int, options *Options) ([]byte, error) }
type GoImageEngine ¶
func (*GoImageEngine) Scale ¶
func (e *GoImageEngine) Scale(img image.Image, dstWidth int, dstHeight int, upscale bool, trans Transformation) *image.NRGBA
func (*GoImageEngine) TransformGIF ¶
func (e *GoImageEngine) TransformGIF(img *imagefile.ImageFile, width int, height int, options *Options, trans Transformation) ([]byte, error)
type Transformation ¶
Click to show internal directories.
Click to hide internal directories.