Skip to content

Draft: feat(users): Add alpha 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
Screenshot_20240531_164244 Screenshot_20240610_100128.cleaned

TODO

This is just an early version so I could get some feedback and receive help continuing developing this feature.

Features:

  • Improve implementation.
    • I'm not the biggest fan of how I implemented things. The way this works is that once cropped image is set, it creates a cropped version of the image file into /tmp, and uses its URL from there to store the image into the avatar picture. I only did it this way because that's how I knew what to do. I would really appreciate somebody with more expertise here.
  • Provide input to make the circle shrink and grow in size.
  • Change the visuals. Help might be wanted here, too.
    • 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 and partially cut the handles?
  • 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.
  • Fix: The circle does not readjust itself if the dialog is resized.
Edited by Kuneho Cottonears

Merge request reports