Skip to content

Commit

Permalink
chore(fix): error
Browse files Browse the repository at this point in the history
  • Loading branch information
yqchilde committed Feb 28, 2023
1 parent b35b2fe commit 4def064
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/memepicture/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ func featureImage(url, b64, cacheDir string) (original, thumbnail string, err er
// 下载图片
resp, err := http.Get(url)
if err != nil {
return
return "", "", err
}
defer resp.Body.Close()

// 保存图片
file, err := os.Create(tmpFile)
if err != nil {
os.Remove(tmpFile)
return
return "", "", err
}
defer file.Close()
if _, err := io.Copy(file, resp.Body); err != nil {
os.Remove(tmpFile)
return
return "", "", err
}
}
if b64 != "" {
// 保存图片
if err := utils.Base64ToImage(b64, tmpFile); err != nil {
os.Remove(tmpFile)
return
return "", "", err
}
}

Expand Down

0 comments on commit 4def064

Please sign in to comment.