From 99efbe1d1f95c61ff1536bb89e64490a194f5da2 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 18 Sep 2019 15:34:29 -0400 Subject: [PATCH] preserve image extension --- activity.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/activity.go b/activity.go index a11a6ef..feb1ba8 100644 --- a/activity.go +++ b/activity.go @@ -165,7 +165,12 @@ func savedonk(url string, name, desc, media string, localize bool) *Donk { goto saveit } 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 { log.Printf("not saving large attachment") localize = false