preserve image extension

This commit is contained in:
Ted Unangst 2019-09-18 15:34:29 -04:00
parent 1139c2886f
commit 99efbe1d1f
1 changed files with 6 additions and 1 deletions

View File

@ -165,7 +165,12 @@ func savedonk(url string, name, desc, media string, localize bool) *Donk {
goto saveit goto saveit
} }
data = img.Data data = img.Data
media = "image/" + img.Format format := img.Format
media = "image/" + format
if format == "jpeg" {
format = "jpg"
}
xid = xid + "." + format
} else if len(data) > 100000 { } else if len(data) > 100000 {
log.Printf("not saving large attachment") log.Printf("not saving large attachment")
localize = false localize = false