Avatar URL
Open, Needs TriagePublic

Description

At the moment, the only way to get a user's avatar image is to fetch the Person data through OCS and then read the avatarURL out of that. While this is nice and abstract, it would be incredibly handy to be able to simply point at e.g. https://ocsserverurl/avatar/username and then be redirected to the actual URL for that user's avatar image, the way we can currently point people to https://ocsserverurl/profile/username and get to that user's profile page.

So, for e.g. we might have https://store.kde.org/avatar/leinir redirecting to the full size of the avatar image at https://cn.opendesktop.org/cache/1000x1000-2/img/4/2/5/c/351ac053b4e23650cf7f071f15ed545cb167.jpg (and, indeed, https://store.kde.org/avatar/leinir/64x64 redirecting to https://cn.opendesktop.org/cache/64x64-2/img/4/2/5/c/351ac053b4e23650cf7f071f15ed545cb167.jpg or otherwise resized image)

This functionality would also want to be codified in the next version of the OCS standard, but it would similarly be handy to be able to test it out in practise.

leinir created this task.Nov 29 2018, 2:59 PM
apol added a comment.Nov 29 2018, 3:07 PM

+1 that would make it much easier to integrate the usage of OCS data in applications.

For inspiration, here's how they implement it in gravatar:
https://en.gravatar.com/site/implement/images/

That's indeed good inspiration - don't really see a reason not to follow their examples, so for the options, instead of the magic stuff above, we could do...

https://ocsserverurl/avatar/username?s=64 for a 64 px square image :)

Just had a quick look at the spec, and it says we only allow alphanumeric characters for the username, so we could also add the file suffix option described on gravatar's site, so...

https://ocsserverurl/avatar/username.png?s=128 would give you a 128px square image in png format.

leinir reassigned this task from ronaldv to siyuandong.Apr 13 2021, 8:57 AM
leinir added a subscriber: ronaldv.

Currently you can use the following on store.kde.org:

or

or gravatar like

or

A redirect to the file is then returned as the result.
A file conversion is currently not implemented and also not planned.

@alexanderschmidt If you will pardon my excessive use of the English language here: Awesome :D That covers pretty much every reasonable base, i feel, and gives us plenty to work with.

Not converting files also seems entirely sensible, there's no particularly good reason for that (anything anybody is likely to throw it at should really be able to just... take whatever image format is suitable for the store anyway).

Thanks a bunch! This allows us to move forward with the swiftness on a couple of things, really great stuff :)

ps: all the above is said without testing things, but i assume you've done so anyway ;)