From 8a248696e94e2756dee3f2a000fe8609a0c2111c Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 27 Jun 2016 12:12:30 +0200 Subject: Use a gopher as default avatar (rather than the gravatar logo) (#3208) Also changes the avatar from a jpeg to a png, to allow for transparent background. The indexed png is also smaller in size. Note that at the moment the default avatar is only used when the user requested a custom avatar and the custom avatar file is not found (should never happen). In the future the default avatar could be used as a default return when by-mail avatar lookups fail too (both gravatar and libravatar support passing a default) --- models/user.go | 2 +- modules/base/tool.go | 2 +- public/img/avatar_default.jpg | Bin 6238 -> 0 bytes public/img/avatar_default.png | Bin 0 -> 4048 bytes 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 public/img/avatar_default.jpg create mode 100644 public/img/avatar_default.png diff --git a/models/user.go b/models/user.go index e6717aec..f4c5b669 100644 --- a/models/user.go +++ b/models/user.go @@ -240,7 +240,7 @@ func (u *User) GenerateRandomAvatar() error { } func (u *User) RelAvatarLink() string { - defaultImgUrl := "/img/avatar_default.jpg" + defaultImgUrl := "/img/avatar_default.png" if u.Id == -1 { return defaultImgUrl } diff --git a/modules/base/tool.go b/modules/base/tool.go index 22a90daf..f045cb22 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -207,7 +207,7 @@ func HashEmail(email string) string { // AvatarLink returns avatar link by given email. func AvatarLink(email string) string { if setting.DisableGravatar || setting.OfflineMode { - return setting.AppSubUrl + "/img/avatar_default.jpg" + return setting.AppSubUrl + "/img/avatar_default.png" } return setting.GravatarSource + HashEmail(email) diff --git a/public/img/avatar_default.jpg b/public/img/avatar_default.jpg deleted file mode 100644 index f97aaaf0..00000000 Binary files a/public/img/avatar_default.jpg and /dev/null differ diff --git a/public/img/avatar_default.png b/public/img/avatar_default.png new file mode 100644 index 00000000..fed568a1 Binary files /dev/null and b/public/img/avatar_default.png differ -- cgit v1.2.3