Bug 426932 - KCM tries to set images as icons that are too large
Summary: KCM tries to set images as icons that are too large
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_users (show other bugs)
Version: 5.19.90
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords: regression
: 427764 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-24 19:34 UTC by David Redondo
Modified: 2020-12-15 15:28 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2020-09-24 19:34:35 UTC
SUMMARY
The accounts service has a limit on the size that icons can be. The kcm assumes that calls to accounts service will always succeed, and will never show the error message to the user.

STEPS TO REPRODUCE
1. Select an image with size larger than 1 MB as avatar
2. Hit apply

OBSERVED RESULT
The image is not set as avatar

EXPECTED RESULT
The kcm needs to do some error handling and at least show the error message to the user (for example as an inline message). Or resize the image like the old kcm did.
Comment 1 David Redondo 2020-09-24 19:44:54 UTC

*** This bug has been marked as a duplicate of bug 22177 ***
Comment 2 David Redondo 2020-09-24 19:45:16 UTC

*** This bug has been marked as a duplicate of bug 422177 ***
Comment 3 David Edmundson 2020-09-25 07:50:48 UTC
This is different.

That bug is about change signals on things that are correctly applied.

Though us resizing via  temp file would cause accounts service to always copy into icons instead of just updating the path which would solve that bug.
Comment 4 David Redondo 2020-09-25 07:53:50 UTC
(In reply to David Edmundson from comment #3)
> This is different.
> 
> That bug is about change signals on things that are correctly applied.
> 
> Though us resizing via  temp file would cause accounts service to always
> copy into icons instead of just updating the path which would solve that bug.

Fair enough, was probably a bit tired yesterday and didn't read correctly.
Comment 5 Bug Janitor Service 2020-09-25 13:59:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/163
Comment 6 David Redondo 2020-10-05 13:19:18 UTC
Git commit 05768142c17600c8d4583f171d08157ecc337390 by David Redondo.
Committed on 05/10/2020 at 13:19.
Pushed by davidre into branch 'master'.

Add some rudimentary error handling to users kcm

Don't fail silently when an error occurs otherwise the kcm just looks broken.
Show at least an inline message so the user knows that something went wrong.
The comment was wrong. We can distinguish why an error occured. Furthermore,
even if it is a permission denied error we do not know if the user canceled
the action or if it failed for some other reason so also treat that as an
error.
Related: bug 425036
FIXED-IN:5.20
CCMAIL:uhhadd@gmail.com

M  +17   -1    kcms/users/package/contents/ui/UserDetailsPage.qml
M  +13   -0    kcms/users/src/CMakeLists.txt
M  +36   -4    kcms/users/src/user.cpp
M  +12   -1    kcms/users/src/user.h
M  +2    -2    kcms/users/src/usermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/05768142c17600c8d4583f171d08157ecc337390
Comment 7 David Redondo 2020-10-05 13:20:27 UTC
Git commit 8500046453ae90862f72049e1a24ec804ce85cff by David Redondo.
Committed on 05/10/2020 at 13:20.
Pushed by davidre into branch 'cherry-pick-05768142'.

Add some rudimentary error handling to users kcm

Don't fail silently when an error occurs otherwise the kcm just looks broken.
Show at least an inline message so the user knows that something went wrong.
The comment was wrong. We can distinguish why an error occured. Furthermore,
even if it is a permission denied error we do not know if the user canceled
the action or if it failed for some other reason so also treat that as an
error.
Related: bug 425036
FIXED-IN:5.20
CCMAIL:uhhadd@gmail.com


(cherry picked from commit 05768142c17600c8d4583f171d08157ecc337390)

M  +17   -1    kcms/users/package/contents/ui/UserDetailsPage.qml
M  +13   -0    kcms/users/src/CMakeLists.txt
M  +36   -4    kcms/users/src/user.cpp
M  +12   -1    kcms/users/src/user.h
M  +2    -2    kcms/users/src/usermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/8500046453ae90862f72049e1a24ec804ce85cff
Comment 8 Bug Janitor Service 2020-10-05 13:20:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/175
Comment 9 Patrick Silva 2020-10-15 17:53:00 UTC
*** Bug 427764 has been marked as a duplicate of this bug. ***
Comment 10 Bug Janitor Service 2020-12-11 22:47:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/262
Comment 11 Nate Graham 2020-12-15 15:27:55 UTC
Git commit b0af2127b4177392e915bd621fd41a082365a0b1 by Nate Graham, on behalf of Carson Black.
Committed on 15/12/2020 at 15:26.
Pushed by ngraham into branch 'master'.

[kcms/users]: Resize provided image to always be smaller than 1MB

This prevents accounts service from complaining about too large files

M  +38   -1    kcms/users/src/user.cpp
M  +2    -1    kcms/users/src/user.h

https://invent.kde.org/plasma/plasma-desktop/commit/b0af2127b4177392e915bd621fd41a082365a0b1