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

Maintain aspect ratio of non-square avatar uploads #1268

Closed
1 of 7 tasks
tobias-- opened this issue Mar 15, 2017 · 8 comments
Closed
1 of 7 tasks

Maintain aspect ratio of non-square avatar uploads #1268

tobias-- opened this issue Mar 15, 2017 · 8 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@tobias--
Copy link

  • Gitea version (or commit ref): 1.1.0
  • Git version: irrelevant
  • Operating system: irrelevant
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When uploading a non-square image as an avatar, it gets resized to a square image. This results in distorted avatars. In my opinion, It would be reasonable to crop the image and maintaining the original aspect ratio.

https://github.com/go-gitea/gitea/blob/master/models/user.go#L431

Unfortunately, the used library for image resizing (https://github.com/nfnt/resize) does not seem to support cropping.

@lunny lunny added this to the 1.x.x milestone Mar 16, 2017
@lunny lunny added the type/enhancement An improvement of existing functionality label Mar 16, 2017
@jhasse
Copy link

jhasse commented Mar 17, 2017

Gogs issue: gogs/gogs#4132

@edgar-bonet
Copy link

I would pad, rather than crop, the uploaded image.

@bkcsoft
Copy link
Member

bkcsoft commented Aug 8, 2017

@svarlamov
Copy link
Contributor

I think that this could be done on the front-end before it is uploaded (similar to GH) using something like this

@stale
Copy link

stale bot commented Feb 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 10, 2019
@stale
Copy link

stale bot commented Feb 24, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed Feb 24, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Feb 25, 2019
@lafriks lafriks removed this from the 1.x.x milestone Feb 26, 2019
lafriks pushed a commit that referenced this issue May 25, 2019
* Crop avatar before resizing (#1268)

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

* Fix spelling error

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

buhtz commented Jul 18, 2019

Automatic closing of Issues make no sense.

Please give a status about this Issue? Is it fixed? Will it be fixed?

@lunny
Copy link
Member

lunny commented Jul 18, 2019

Sorry, It is fixed by #7025

jeffliu27 pushed a commit to jeffliu27/gitea that referenced this issue 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
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

8 participants