-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add cropping support for avatar editing #32565
base: main
Are you sure you want to change the base?
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. |
Can we put the cropping content into a fomantic modal instead of dumping it into the page body like that? Edit: Or maybe it's okay, given that this form requires to hit the submit button below anyways. |
Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
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.