mugshot icon indicating copy to clipboard operation
mugshot copied to clipboard

AccountsService set icon not working for avatar larger than 1MB

Open 1earch opened this issue 4 years ago • 5 comments

Hello,

When selecting a custom avatar larger than 96x96, it is not applied on behalf of AccountsService. Would it be possible to add a warning message? In addition, it could be great that the script performs an automatic resize after warning the user.

I can work on a PR if needed... In this case, do you have a preference on the image manipulation lib?

1earch avatar Sep 14 '20 12:09 1earch

I've not seen this. Is the 96x96 file restriction documented somewhere, or is this a problem with Mugshot itself?

bluesabre avatar Sep 05 '21 19:09 bluesabre

@1earch Just following up here... do you have a link to this documented requirement?

bluesabre avatar Sep 27 '22 03:09 bluesabre

Hi @bluesabre,

Sorry for the delay! Totally missed out the last notification! I haven't seen any documentation around this point...

Here are the steps to reproduce, in order to see AccountsService error:

  1. Open Mugshot in verbose mode
  2. Search for a new icon in JPG whose size is 850x850 (other may also confirm the bug)
  3. Get the /tmp/ filepath for the user
  4. Execute DBus command which will be executed by mugshot:
$ dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetIconFile string:/tmp/...
Error org.freedesktop.Accounts.Error.Failed: file '/tmp/...' is too large to be used as an icon

1earch avatar Oct 02 '22 15:10 1earch

Just found the limitation here: https://github.com/freedesktop/accountsservice/blob/0247dd0359df854768c21e6d5a49d35d6be563ae/src/user.c#L1784

There is an artificial limit of 1MB

1earch avatar Oct 02 '22 15:10 1earch

I also found this thread, indicating that the bug was fixed, but I still get it with 0.4.3

1earch avatar Oct 02 '22 15:10 1earch