feat(users): Add avatar cropping
Reason for the change
On GNOME, the user is able to crop an image when setting an avatar picture. I thought integrating this into KDE would be beneficial as users wouldn't have to make crops in external applications when setting an avatar.
Screenshots or screen recordings
Before | After |
---|---|
TODO
Features:
-
Provide input to make the circle shrink and grow in size. -
Change the visuals. -
The image should be greyed out while the circle should keep the image's lightness. Probably be better if the border was white, too. -
Move inside handles in the circle?
-
-
Prevent the user from moving out of bounds. There's no limit for how far the user can drag the circle. -
Maybe center the circle in the dialog? -
The user has to scroll vertically to view the entire image. Would it be better if the whole image was on a single view?
Bugs:
-
Fix: Before applying, the user should be able to select a different image and crop that, and have that reselection shown in the face preview icon above. -
Fix: If the user clicks on anywhere of the handles, it will jump and align its top left corner with the cursor. -
Fix: The top handle doesn't seem like it can keep up with the speed of the mouse.
Note
In the backend, the way this works is that once cropped image is set, it creates a cropped version of the image file into /tmp
. When the user saves their settings, this image is copied to their account settings (so, no worry about the file disappearing). Not the best solution I think, but it works. I'm open for alternatives.
Edited by Kuneho Cottonears