Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert2Webp ¶
将图片转换成webp格式
reader: 源文件,支持:jpeg、png、bmp、gif quality: 0 ~ 100
Usage example:
func main() {
img,err:= os.Open("./asset/a.png")
if err!=nil{
return
}
res,err:=Convert2Webp(img,30)
if err!=nil{
return
}
ioutil.WriteFile("./asset/a.webp",res,0666)
}
func Webp2Others ¶
将webp转换成其他格式
reader: 源文件,仅支持:webp quality: 0 ~ 100
Usage example:
func main() {
source, err := os.Open("./asset/a.webp")
if err != nil {
log.Fatalln(err)
}
data, err := Webp2Others(source, "png", 90)
if err != nil {
log.Fatalln(err)
}
wp, err := os.Create("./asset/b.png")
if err != nil {
log.Fatalln(err)
}
wp.Write(data)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.