This commit is contained in:
potassium 2024-12-27 00:31:19 +03:00
parent ddc2c6640f
commit 0912afa68a

View File

@ -98,13 +98,7 @@ func GetImage(link string) (image.Image, error) {
}
defer resp.Body.Close()
if resp == nil {
log.Fatal("pizdec")
}
img, _, err := image.Decode(resp.Body)
if img == nil {
log.Fatal("img is nil")
}
if err != nil {
return nil, err
}
@ -123,14 +117,7 @@ buf := new(bytes.Buffer)
takeOne(ShuffledCardPool)))),
imageutils.Right,
)
if img == nil {
log.Fatal("pizdec")
}
err = png.Encode(
buf,
img,
)
err = png.Encode(buf, img)
if err != nil {
log.Println("error on decode:", err)
}