Open yuhang2 opened 3 years ago
DecodeRGBA
will return an *image.RGBA
which can be resized using the standard draw
package golang.org/x/image/draw
.
The following should work:
m, err := webp.DecodeRGBA((data)
if err != nil {
log.Fatal(err)
}
width := 100
height := 200
scale := draw.BiLinear
rect := image.Rect(0, 0, width, height)
dst := image.NewRGBA(rect)
scale.Scale(dst, rect, m, src.Bounds(), draw.Over, nil)
Does this library support resize images?