save custom avatar as PNG
This commit is contained in:
parent
6a664e88c7
commit
1559bd58e7
5 changed files with 29 additions and 20 deletions
|
@ -39,6 +39,8 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
//FIXME: remove cache module
|
||||
|
||||
var gravatarSource string
|
||||
|
||||
func UpdateGravatarSource() {
|
||||
|
@ -153,7 +155,7 @@ func (this *Avatar) Encode(wr io.Writer, size int) (err error) {
|
|||
if img, err = decodeImageFile(imgPath); err != nil {
|
||||
return
|
||||
}
|
||||
m := resize.Resize(uint(size), 0, img, resize.NearestNeighbor)
|
||||
m := resize.Resize(uint(size), 0, img, resize.Lanczos3)
|
||||
return jpeg.Encode(wr, m, nil)
|
||||
}
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ func Contexter() macaron.Handler {
|
|||
Session: sess,
|
||||
}
|
||||
// Compute current URL for real-time change language.
|
||||
ctx.Data["Link"] = setting.AppSubUrl + ctx.Req.URL.Path
|
||||
ctx.Data["Link"] = setting.AppSubUrl + strings.TrimSuffix(ctx.Req.URL.Path, "/")
|
||||
|
||||
ctx.Data["PageStartTime"] = time.Now()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue