bluesabre / mugshot

Mugshot - User Management Utility for Linux
GNU General Public License v3.0
71 stars 12 forks source link

AccountsService set icon not working for avatar larger than 1MB #14

Open 1earch opened 4 years ago

1earch commented 4 years ago

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?

bluesabre commented 3 years ago

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

bluesabre commented 2 years ago

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

1earch commented 2 years ago

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 commented 2 years ago

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

There is an artificial limit of 1MB

1earch commented 2 years ago

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