Skip to content

馃崚kcms/users: refactor cropping

Harald Sitter requested to merge work/cherry-pick-1b23d61f into Plasma/6.2

kcms/users: refactor cropping

this makes it so cropping works more consistently and more efficiently

at the heart of the cropping we now hold a qtemporaryfile into which we write the cropped image. lifetime of the file is managed through a unique_ptr so they get cleaned up consistently. by using qtemporaryfile we avoid general TOCTOU problems.

when the face doesn't change we don't change anything.

the crop value gets reset after applying a crop so later image changes get the correct new (possibly null) crop rather than the old (possibly not null) crop

cropping still happens inside the User class. this is necessary so the preview before applying is actually crop.

(cherry picked from commit 1b23d61f)

Co-authored-by: Harald Sitter sitter@kde.org

Merge request reports

Loading