1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

save custom avatar as PNG

This commit is contained in:
Unknwon
2015-11-13 16:43:43 -05:00
parent 6a664e88c7
commit 1559bd58e7
5 changed files with 29 additions and 20 deletions

View File

@@ -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)
}