Closed Bug 555896 Opened 13 years ago Closed 12 years ago

Identicons for default avatars

Categories

(support.mozilla.org :: Knowledge Base Software, task, P2)

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jsocol, Assigned: jsocol)

References

Details

Eventually, we'd like some kind of identifiable/unique default avatar for users, which seems like a perfect job for Identicons[1]!

(For those who don't feel like clicking the link, Identicons are small, square image-hashes of a string or number. In this case, it will probably be based on the MD5 hash of the user's email address. They are highly unique and consistent--so long as users stick to one email address.)

I found a pure-Python implementation[2] which the author tells me is under the BSD license. He also said he'll be putting the license in the file and the file on github. Right now it's on coderepos.org and doesn't contain a license, I had to ask.

This probably involves generating Identicon avatars for existing, avatar-less users, which should be a one-off task, and creating avatars for new registrations (which should definitely happen off-thread).

Putting this in 2.1 for now, because I'm guessing that's when we'll need to start doing this.

[1] http://en.wikipedia.org/wiki/Identicon
[2] http://coderepos.org/share/browser/lang/python/misc/identicon.py
Looks like the author put it up on github[1] with the license.

Also, are we talking off-thread as in via a queue, or simply branching a new thread off of the server process to generate an Identicon?

[1] http://github.com/shnjp/identicon
Can Gravatar be used? If so django-avatar[1] is a reusable app for handling avatars and can be set up to fallback to Gravatar if the user doesn't have an avatar. We would probably have to create a jinja2 version of that though.

[1] http://github.com/ericflo/django-avatar
(In reply to comment #1)
> Looks like the author put it up on github[1] with the license.

Yeah, I emailed him and asked him to. It's not packaged with setuptools, though.

> Also, are we talking off-thread as in via a queue, or simply branching a new
> thread off of the server process to generate an Identicon?

The queue. We'll need to get the infrastructure for Rabbit/Celery in place--but we need that for email notifications anyway.

(In reply to comment #2)
> Can Gravatar be used?

As far as I remember, no. We can ask again, though.
Priority: P3 → P2
http://github.com/jsocol/kitsune/commit/a017c3e2f9b5dab7a5c20974ed27e30776bbef98

Management command, pull request sent for r?

This finds all the users with NULL (~70k/~71k) avatarData and fills it with an identicon based on the MD5 of their email. This means the avatar will show up everywhere in Tiki, as well, since it's displayed with the Tiki script.

Once we have user registration in Kitsune, we'll be able to do this as a celery task pretty easily. Until then, we'll need to run this periodically to pick up new registrations. It's pretty fast and I don't think we get that many registrations/day, so we can probably ask IT to cron it to run in the middle of the night.

To test:
1) Run the management command.*
2) Pick a user, any user, who didn't have an avatar before, let's call them "bob".
3) Go to /tiki-show_user_avatar.php?user=bob, and you should see a nice 48x48 image. Unique email addresses will generate unique avatars.

*It took around half an hour, I think, which is roughly 1/40th of a second per user with the data I had--not too shabby. YMMV.
Depends on: 569649
Just landed this[1], now all we need is to get someone from IT to run the
management command. Filed bug 569649.

[1] http://github.com/jsocol/kitsune/commit/84ee397fda9
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
http://support-stage-new.mozilla.com/en-US/forums/test-b/596 is missing his/her avatar, and when I right click and try to get the image's URL, Tiki tries to send me tiki-show_user_avatar.php
(In reply to comment #6)
> http://support-stage-new.mozilla.com/en-US/forums/test-b/596 is missing his/her
> avatar

Avatars were generated for users that already existed, and are set up to run at 1:15am every night for users who register later. Going to this URL now shows a little windmill-like avatar.
Identicons are implemented, and comment 7 is right on the money.

https://support-stage-new.mozilla.com/tiki-show_user_avatar.php?user=bob works, too.

Verified FIXED.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.