mirror of https://github.com/velour/catbase.git
meme: fix shortcuts
This commit is contained in:
parent
d2089279be
commit
66460159cd
|
@ -123,10 +123,13 @@ func (p *MemePlugin) genMeme(meme, text string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
u, err := url.Parse(imgName)
|
u, err := url.Parse(imgName)
|
||||||
if err != nil {
|
if err != nil || u.Scheme == "" {
|
||||||
|
log.Debug().Err(err).Str("imgName", imgName).Msgf("url not detected")
|
||||||
u, _ = url.Parse("https://imgflip.com/s/meme/" + imgName)
|
u, _ = url.Parse("https://imgflip.com/s/meme/" + imgName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Debug().Msgf("Attempting to download url: %s", u.String())
|
||||||
|
|
||||||
img := DownloadTemplate(u)
|
img := DownloadTemplate(u)
|
||||||
r := img.Bounds()
|
r := img.Bounds()
|
||||||
w := r.Dx()
|
w := r.Dx()
|
||||||
|
|
Loading…
Reference in New Issue