Closed gabriel closed 9 years ago
Interesting. The one concern is what if people are going through a proxy or over Tor?
Also, how would this work on local vs. live testing?
Ok, we'll whip up an API and punt on the proxy/Tor issues here for now. We should revisit.
@gabriel what if there's no picture? should we 404 or show the default doggie?
404 is good
On Wed, Mar 4, 2015 at 4:35 PM, Maxwell Krohn notifications@github.com wrote:
@gabriel https://github.com/gabriel what if there's no picture? should we 404 or show the default doggie?
— Reply to this email directly or view it on GitHub https://github.com/keybase/client/issues/242#issuecomment-77282543.
@malgorithms, do you mind handling this one?
yeah, I'll have this done this morning.
ok, this is live. There are 2 formats for every user right now: square_200, and square_40. The square_200 is the default image if you don't ask for one of the formats.
Also, if you note the URL structure, I don't present it as an "API" call - this is just a matter of preference, but like chris/key.asc, I like the non API looking URL.
Anyway, some examples:
https://keybase.io/chris/picture (uses default, which is configurable server-side) https://keybase.io/chris/picture?format=square_200 https://keybase.io/chris/picture?format=square_40
https://keybase.io/chris/picture?format=fake_format https://keybase.io/shitbag1000/picture (user doesn't exist) https://keybase.io/cloudflare/picture (user exists but doesn't have a picture)
If we need other formats, let me know. We should try to make as few as possible and do resizing client-side. For example, in the browser I typically use the 200x200 for small thumbs, and it looks good for retina and regular screens.
Obviously that doesn't work if a client can't rescale or does shitty (nearest-neighbor) interpolation. In which case I can add a format.
Reopen if you need anything else.
I think we should an api call: https://keybase.io/_/api/1.0/{username}/picture?type=normal (this redirects to the picture)
Then we don't need to include it in the RPC and the daemon doesn't have to worry about photos and we can have user objects thin by default.
Kind of like facebook https://developers.facebook.com/docs/graph-api/reference/v2.2/user/picture
For example, zuck is id=4: http://graph.facebook.com/4/picture?type=normal
Benefits:
Probably should have done this first and we wouldn't have had to do this in the RPC? Oops :)