-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Allow cropping an avatar before setting it #32565
Conversation
|
Thank you for the suggestion. The code has been changed according to the specifications. Additionally, I have added the necessary prompt to inform users that cropped images will be saved in JPEG format uniformly. |
Gitea already supports formats like animated PNG and WEBP for avatars, so with the passthrough, they should continue to work. |
Thank you. Both requirements have been implemented. |
Made some changes in 5f893c3 , the code is also simplified:
|
Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: delvh <[email protected]>
Co-authored-by: delvh <[email protected]>
* giteaofficial/main: Allow cropping an avatar before setting it (go-gitea#32565) Add webpack EnvironmentPlugin (go-gitea#32661) Move team related functions to service layer (go-gitea#32537) Make frontend unit test code could know it is in testing (go-gitea#32656) Add priority to protected branch (go-gitea#32286)
In response to the issues raised in #31990, and related discussions in #31991;
I tend to agree with @silverwind's viewpoint (using
object-fit: cover;
is equivalent to actively cropping the image for the user, which cannot guarantee the crop is what the user wants).Therefore, I believe this issue should be addressed in two parts:
①, Add a border to the user's avatar, similar to how GitHub does it; this way, unconventionally proportion images configured through the API won't look as ugly as mentioned in the issue.
②, Provide a cropping tool on the avatar editing page, allowing users to select the cropping area themselves. This way, users can decide the displayed area of the image, rather than us deciding for them.
This PR is the solution for part ②; I will propose the solution for part ① in another PR.