Documentation ¶
Overview ¶
Package graphicsmagick provides a GraphicsMagick imageserver.Handler implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { // Executable is the path to "gm" executable, usually "/usr/bin/gm". Executable string // Timeoput is an optional timeout for process. Timeout time.Duration // TempDir is an optional temp directory for image files. TempDir string // AllowedFormats is an optional list of allowed formats. AllowedFormats []string }
Handler is a GraphicsMagick imageserver.Handler implementation.
It processes the Image with the GraphicsMagick command line (mogrify command).
All params are extracted from the "graphicsmagick" node param and are optionals.
Params (see GraphicsMagick documentation for more information about arguments):
- 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 imageserver.Handler.
Click to show internal directories.
Click to hide internal directories.