diff --git a/coolq/bot.go b/coolq/bot.go index 0a2fffa..6818e1c 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -159,7 +159,7 @@ func (bot *CQBot) uploadLocalImage(target message.Source, img *LocalImageElement } if mt == "image/webp" && base.ConvertWebpImage { newname := img.File + ".png" - err := global.ConvertImagePng(img.File, newname) + err := global.ConvertImage(img.File, newname) if err != nil { return nil, errors.Wrap(err, "convert webp image error") } diff --git a/global/codec.go b/global/codec.go index 4ef6bbc..ebdb241 100644 --- a/global/codec.go +++ b/global/codec.go @@ -47,7 +47,7 @@ func ExtractCover(src string, target string) error { return errors.Wrap(cmd.Run(), "extract video cover failed") } -func ConvertImagePng(src string, target string) error { - cmd := exec.Command("ffmpeg", "-i", src, "-y", "-f", "png", target) +func ConvertImage(src string, target string) error { + cmd := exec.Command("ffmpeg", "-i", src, "-y", target) return errors.Wrap(cmd.Run(), "convert image to png failed") }