aboutsummaryrefslogtreecommitdiff
path: root/weed/images/resizing.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/images/resizing.go')
-rw-r--r--weed/images/resizing.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/images/resizing.go b/weed/images/resizing.go
index 7e4a88c42..e644570cb 100644
--- a/weed/images/resizing.go
+++ b/weed/images/resizing.go
@@ -6,6 +6,7 @@ import (
"image/gif"
"image/jpeg"
"image/png"
+ "github.com/chai2010/webp"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/disintegration/imaging"
@@ -37,6 +38,8 @@ func Resized(ext string, data []byte, width, height int) (resized []byte, w int,
jpeg.Encode(&buf, dstImage, nil)
case ".gif":
gif.Encode(&buf, dstImage, nil)
+ case ".webp":
+ webp.Encode(&buf, dstImage, &webp.Options{Quality: 70})
}
return buf.Bytes(), dstImage.Bounds().Dx(), dstImage.Bounds().Dy()
} else {