add svg output support, but only with primitive

This commit is contained in:
Will Norris 2019-10-13 09:06:27 -07:00
parent b951a9ccc3
commit a1e81bb21f
3 changed files with 17 additions and 2 deletions

View file

@ -19,6 +19,7 @@ const (
optFlipHorizontal = "fh"
optFormatJPEG = "jpeg"
optFormatPNG = "png"
optFormatSVG = "svg"
optFormatTIFF = "tiff"
optPrimitivePrefix = "p"
optRotatePrefix = "r"
@ -70,7 +71,7 @@ type Options struct {
// will always be overwritten by the value of Proxy.ScaleUp.
ScaleUp bool
// Desired image format. Valid values are "jpeg", "png", "tiff".
// Desired image format. Valid values are "jpeg", "png", "svg", "tiff".
Format string
// Crop rectangle params
@ -256,7 +257,7 @@ func ParseOptions(str string) Options {
options.FlipHorizontal = true
case opt == optScaleUp: // this option is intentionally not documented above
options.ScaleUp = true
case opt == optFormatJPEG, opt == optFormatPNG, opt == optFormatTIFF:
case opt == optFormatJPEG, opt == optFormatPNG, opt == optFormatSVG, opt == optFormatTIFF:
options.Format = opt
case opt == optSmartCrop:
options.SmartCrop = true