aboutsummaryrefslogtreecommitdiffstats
path: root/services/user
diff options
context:
space:
mode:
Diffstat (limited to 'services/user')
-rw-r--r--services/user/user.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/services/user/user.go b/services/user/user.go
index d52a2f404b..5148f2168d 100644
--- a/services/user/user.go
+++ b/services/user/user.go
@@ -6,7 +6,6 @@ package user
import (
"context"
"fmt"
- "image/png"
"io"
"time"
@@ -244,7 +243,7 @@ func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) error {
// UploadAvatar saves custom avatar for user.
func UploadAvatar(u *user_model.User, data []byte) error {
- m, err := avatar.Prepare(data)
+ avatarData, err := avatar.ProcessAvatarImage(data)
if err != nil {
return err
}
@@ -262,9 +261,7 @@ func UploadAvatar(u *user_model.User, data []byte) error {
}
if err := storage.SaveFrom(storage.Avatars, u.CustomAvatarRelativePath(), func(w io.Writer) error {
- if err := png.Encode(w, *m); err != nil {
- log.Error("Encode: %v", err)
- }
+ _, err := w.Write(avatarData)
return err
}); err != nil {
return fmt.Errorf("Failed to create dir %s: %w", u.CustomAvatarRelativePath(), err)