Gitea: Maintain aspect ratio of non-square avatar uploads

Created on 15 Mar 2017  路  8Comments  路  Source: go-gitea/gitea

  • 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

    • [x] 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.

kinenhancement revieweconfirmed

Most helpful comment

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

All 8 comments

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

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

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.

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

Automatic closing of Issues make no sense.

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

Sorry, It is fixed by #7025

Was this page helpful?
0 / 5 - 0 ratings