From 7ac8eaba925cb9f3d02bc93717cb3c573fd26ec2 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 24 May 2017 10:52:05 -0400 Subject: PLT-6534 Rotated uploaded profile pictures to be upright (#6482) --- app/user.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/user.go') diff --git a/app/user.go b/app/user.go index 2a570c7ac..e5cc20568 100644 --- a/app/user.go +++ b/app/user.go @@ -805,6 +805,11 @@ func SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppE return model.NewLocAppError("SetProfileImage", "api.user.upload_profile_user.decode.app_error", nil, err.Error()) } + file.Seek(0, 0) + + orientation, _ := getImageOrientation(file) + img = makeImageUpright(img, orientation) + // Scale profile image img = imaging.Fill(img, utils.Cfg.FileSettings.ProfileWidth, utils.Cfg.FileSettings.ProfileHeight, imaging.Center, imaging.Lanczos) -- cgit v1.2.3-1-g7c22