Documentation ¶
Overview ¶
Package graphicsmagick provides a GraphicsMagick Image Server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { Executable string // path to "gm" executable, usually "/usr/bin/gm" Timeout time.Duration // timeout for process, optional TempDir string // temp directory for image files, optional AllowedFormats []string // allowed format list, optional }
Handler is a GraphicsMagick Image Handler.
It processes the Image with the GraphicsMagick command line (mogrify command).
All params are extracted from the "graphicsmagick" node param and are optionals.
See GraphicsMagick documentation for more information about arguments.
Params:
- width / height: sizes for "-resize" argument (both optionals)
- fill: "^" for "-resize" argument
- ignore_ratio: "!" for "-resize" argument
- only_shrink_larger: ">" for "-resize" argument
- only_enlarge_smaller: "<" for "-resize" argument
- background: color for "-background" argument, 3/4/6/8 lower case hexadecimal characters
- extent: "-extent" param, uses width/height params and add "-gravity center" argument
- format: "-format" param
- quality: "-quality" param
func (*Handler) Handle ¶
func (hdr *Handler) Handle(im *imageserver.Image, params imageserver.Params) (*imageserver.Image, error)
Handle implements Handler.