PLT-6534 Rotated uploaded profile pictures to be upright (#6482)

Этот коммит содержится в:
Harrison Healey
2017-05-24 10:52:05 -04:00
коммит произвёл Corey Hulen
родитель b84891f654
Коммит 7ac8eaba92
2 изменённых файлов: 30 добавлений и 20 удалений

Просмотреть файл

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