mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 04:46:24 +02:00
allow forcing encoding as tiff
This commit is contained in:
parent
c1a9dab401
commit
817908938e
3 changed files with 25 additions and 8 deletions
9
data.go
9
data.go
|
|
@ -29,6 +29,7 @@ const (
|
|||
optFlipHorizontal = "fh"
|
||||
optFormatJPEG = "jpeg"
|
||||
optFormatPNG = "png"
|
||||
optFormatTIFF = "tiff"
|
||||
optRotatePrefix = "r"
|
||||
optQualityPrefix = "q"
|
||||
optSignaturePrefix = "s"
|
||||
|
|
@ -77,7 +78,7 @@ type Options struct {
|
|||
// will always be overwritten by the value of Proxy.ScaleUp.
|
||||
ScaleUp bool
|
||||
|
||||
// Desired image format. Valid values are "jpeg", "png".
|
||||
// Desired image format. Valid values are "jpeg", "png", "tiff".
|
||||
Format string
|
||||
|
||||
// Crop rectangle params
|
||||
|
|
@ -202,8 +203,8 @@ func (o Options) transform() bool {
|
|||
//
|
||||
// Format
|
||||
//
|
||||
// The "jpeg" and "png" options can be used to specify the desired image format
|
||||
// of the proxied image.
|
||||
// The "jpeg", "png", and "tiff" options can be used to specify the desired
|
||||
// image format of the proxied image.
|
||||
//
|
||||
// Signature
|
||||
//
|
||||
|
|
@ -243,7 +244,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:
|
||||
case opt == optFormatJPEG, opt == optFormatPNG, opt == optFormatTIFF:
|
||||
options.Format = opt
|
||||
case strings.HasPrefix(opt, optRotatePrefix):
|
||||
value := strings.TrimPrefix(opt, optRotatePrefix)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue