twaddington / django-gravatar

Essential Gravatar support for Django. Features helper methods, templatetags and a full test suite!
MIT License
149 stars 33 forks source link

'.jpg' suffix is unnecessary #11

Closed yangyubo closed 12 years ago

yangyubo commented 12 years ago

Not all avatars are formatted as ".jpg" . For example, follow url will be failed:

http://gravatar.com/avatar/908e0b099a9d0a625740701559639b83.jpg?s=80&r=g&d=mm

But it works without ".jpg" suffix:

http://gravatar.com/avatar/908e0b099a9d0a625740701559639b83?s=80&r=g&d=mm

According to Gravatar's documentation, '.jpg' suffix may be unnecessary for WEB APPs.

twaddington commented 12 years ago

Thanks for the feedback. Your first example URL seems to work for me just fine. Is it possible your web browser has cached a bad image at that URL? You might try tweaking the "s=" size parameter to force it to fetch a new asset.

All Gravatar images are served up with an "image/jpeg" content-type header. This is why the ".jpg" file extension is optional. However, some client applications won't read the content-type header and need the file extension to know what kind of resource lives at that URL. Unless the .jpg extension is causing a specific problem for you I'd like to leave it the way it is configured.