Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of non-square avatars #7025

Merged
merged 3 commits into from
May 25, 2019
Merged

Improve handling of non-square avatars #7025

merged 3 commits into from
May 25, 2019

Conversation

rfwatson
Copy link
Contributor

@rfwatson rfwatson commented May 23, 2019

Crop avatars before resizing them. This prevents a user's first experience of Gitea being a nasty aspect ratio on their avatar.

Before

Screenshot from 2019-05-23 23-03-36

After

Screenshot from 2019-05-23 23-04-58

Discussion points

Questions

  • CI failing due to the missing github.com/oliamb/cutter dependency - how should this be included/packaged? Go newbie here so advice/help welcome.

@zeripath
Copy link
Contributor

You need to run make vendor and commit

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 23, 2019
@rfwatson
Copy link
Contributor Author

Committed the change to modules.txt but the build still seems to be failing

@zeripath
Copy link
Contributor

You haven't run make vendor and committed

@lunny lunny added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI labels May 24, 2019
@codecov-io
Copy link

codecov-io commented May 24, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@5f05aa1). Click here to learn what that means.
The diff coverage is 29.72%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #7025   +/-   ##
=========================================
  Coverage          ?   41.48%           
=========================================
  Files             ?      441           
  Lines             ?    59526           
  Branches          ?        0           
=========================================
  Hits              ?    24696           
  Misses            ?    31603           
  Partials          ?     3227
Impacted Files Coverage Δ
models/user.go 51.45% <0%> (ø)
modules/avatar/avatar.go 48% <32.35%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f05aa1...597ceb2. Read the comment docs.

@lafriks lafriks added this to the 1.9.0 milestone May 24, 2019
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 24, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 24, 2019
@@ -5,9 +5,15 @@
package avatar

import (
"bytes"
"code.gitea.io/gitea/modules/setting"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import sequence.

@@ -7,7 +7,9 @@ package avatar
import (
"testing"

"code.gitea.io/gitea/modules/setting"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>
Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>
@lafriks lafriks mentioned this pull request May 24, 2019
@zeripath zeripath requested a review from lunny May 25, 2019 08:21
@lafriks lafriks merged commit df25578 into go-gitea:master May 25, 2019
@rfwatson rfwatson deleted the feature/crop_image branch May 25, 2019 16:46
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
* Crop avatar before resizing (go-gitea#1268)

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>

* Fix spelling error

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants