Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar Permalinks #15

Closed
itsthatguy opened this issue Sep 9, 2014 · 2 comments
Closed

Avatar Permalinks #15

itsthatguy opened this issue Sep 9, 2014 · 2 comments

Comments

@itsthatguy
Copy link
Owner

Once we're actually generating avatars procedurally, we can provide a permalink to an avatar's given attributes. That way, if we add more attributes in the future and the mapping changes, people can still use the same avatar.

@rylnd
Copy link
Collaborator

rylnd commented Sep 15, 2014

What if we base64 encode what's returned from Potato#parts and use that as the URI token?

var encoded = new Buffer(JSON.stringify({data: 'foo'})).toString('base64');
// 'eyJkYXRhIjoiZm9vIn0='
var decoded = JSON.parse(new Buffer(encoded, 'base64')).toString('ascii');
// { data: 'foo' }

If you're cool with that, then we just need to figure out what the route should be. @bigtiger had the suggestion of throwing the new avatars under v2/, so that the existing avatars truly never change.

@itsthatguy
Copy link
Owner Author

Oh, good idea. We could also make a change to how we deliver the images.

Scenario

  1. 'key' = Base64 encode the route input string
  2. check for existing image with name that maps to key
  3. if image exists -> return image
  4. if image does not exist -> alrogithmize string to generate new image with name key

Summary

This would allow us to save images for the long haul.

@rylnd rylnd mentioned this issue Sep 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants