Server: Add option to set max profile picture size

Created on 10 Jan 2020  Â·  7Comments  Â·  Source: nextcloud/server

Is your feature request related to a problem? Please describe.
I use an LDAP user backend with roughly >1k User and I expect my LDAP directory to slow down and be bloated if everyone uploads a profile picture with 20 MB.

Describe the solution you'd like
I would like to have a setting that sets the maximum size for profile picture upload. Ideally this setting is accepted regardless of where (ldap, other user backend) the profile picture is send to.

Describe alternatives you've considered
I could also try limiting this within ldap, but I cannot change the UI Text with the max size message easily.

0. Needs triage enhancement

Most helpful comment

I'm in favour of no config switch but sensible default value.
Maybe 2MB is enough :)
Or resize on the flow when uploading a new one :rocket:

All 7 comments

I'm in favour of no config switch but sensible default value.
Maybe 2MB is enough :)
Or resize on the flow when uploading a new one :rocket:

Maybe 2MB is enough :)

Take a picture with your phone and see yourself ;)

Or resize on the flow when uploading a new one

There is already some resize. Avatar is cropped so until you upload a 20 MB square actual size should be smaller. If we save the image with less quality people will complain.

@ClundXIII What picture size would be acceptable?

I guess we should not force people to resize their profile picture manually. Unfortunately pictures taken by modern phones are not that small. I don't think we can pick a value < 10 MB.

So probably it's a feature request for https://github.com/nextcloud/ldap_write_support because nextcloud/server do not upload profile pictures by default to ldap. As temporary solution it's also possible to disable avatar upload: https://github.com/nextcloud/ldap_write_support/commit/5aaddbbe622dda738fd8358c56154317fde07c4a

@ClundXIII What picture size would be acceptable?

I would go for something like 20 - 30 kb max. Simply for the reason that I can cache all of them in the RAM of my ldap vm. This is probably too small for 99.9% of the instances. Maybe I will raise it once everybody settled in.

Nextcloud is currently our main and best supported interface for normal user to edit their profile details. The ldap write support plugin is fairly minimalistic. And I imagine having 2 different avatars (one for ldap, one for nextcloud) would complicate things a lot.

I guess we should not force people to resize their profile picture manually.

For my use case this is kinda acceptable. However an automatic resize roughly based on the uploaded picture size would be ideally. (Based on a value one can set, default to a high value)
I don't think we need an algorithm to EXACTLY resize to the correct size (especially if compression is a thing). But some rough estimation based on pixel size to resize down to +/- 10% of the desired size is more than enough.

Not sure this should go into ldap_write_support, as the files have to be stored and handled somewhere either way. Or possible downloaded in places with not so awesome internet connections. A generic approach is favourable imo.

We might allow bigger sizes to upload, but a smaller max one, which we scale the image down to. @ClundXIII has a special case here, alas making these sizes also configurable… Hm!

I semi solved this issue. We need a separate tool to "glue" all our platforms together anyway. So that is why we made a user portal which also include profile picture editing.

It would be nice to specify what you can edit with nextcloud and what not in the settings. E.g. allow only group editing and display name but not profile picture and email. But I think I should make a new Report in the ldap_write_support repo for that request, right?

It would be nice to specify what you can edit with nextcloud and what not in the settings. E.g. allow only group editing and display name but not profile picture and email. But I think I should make a new Report in the ldap_write_support repo for that request, right?

Aye

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  3Comments

williambargent picture williambargent  Â·  3Comments

ThomasLeister picture ThomasLeister  Â·  3Comments

dl5rcw picture dl5rcw  Â·  3Comments

mama21mama picture mama21mama  Â·  3Comments