add support for webp encoding

This commit is contained in:
Will Norris 2024-05-08 20:33:29 -07:00
parent ef50c1f9a6
commit 0a89d43f75
4 changed files with 79 additions and 22 deletions

View file

@ -20,6 +20,7 @@ const (
optFormatJPEG = "jpeg"
optFormatPNG = "png"
optFormatTIFF = "tiff"
optFormatWEBP = "webp"
optRotatePrefix = "r"
optQualityPrefix = "q"
optSignaturePrefix = "s"
@ -247,7 +248,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 == optFormatTIFF, opt == optFormatWEBP:
options.Format = opt
case opt == optSmartCrop:
options.SmartCrop = true