Project

General

Profile

Actions

Feature #11516

open

Gravatar: one size to rule them all

Added by Peter Leonov over 12 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

It might be useful to request avatar image in one size big enough to display at the profile page. Other sizes could be produced by rescaling the big one to any size we want by just a CSS rule.

This helps reduce load to the gravatar servers, reduce total HTTP request needed to render the page, reduces reflows caused by image been getting its real size on load, and last but not least theme designers get control over the avatar size without intrusion to the server side.


Files

resampling.png (21.1 KB) resampling.png Jean-Philippe Lang, 2012-07-27 22:12
MSIE 8.png (85.8 KB) MSIE 8.png Peter Leonov, 2012-07-27 22:33
Chrome Win.png (86.6 KB) Chrome Win.png Peter Leonov, 2012-07-27 22:33
Firefox Win.png (88.6 KB) Firefox Win.png Peter Leonov, 2012-07-27 22:33
Firefox Mac.png (84.4 KB) Firefox Mac.png Peter Leonov, 2012-07-27 22:33
Opera Mac.png (88.3 KB) Opera Mac.png Peter Leonov, 2012-07-27 22:33
Safari Mac.png (84.1 KB) Safari Mac.png Peter Leonov, 2012-07-27 22:33
Actions #1

Updated by Peter Leonov over 12 years ago

An addition. We could select the most popular avatar size by default to hit a browser cache if the browser has already met this avatar on the other site.

Actions #2

Updated by Jean-Philippe Lang over 12 years ago

I don't know if it's a good idea, most browsers have low-quality algorithms for resampling images (eg. nearest) right?

Actions #3

Updated by Peter Leonov over 12 years ago

AFAIK, the only browser which ever used nearest-neighbor algorithm is MSIE. And MSIE versions 7.0 and 8.0 have a simple CSS tweak to switch to an eye candy bicubic interpolation. As far as MSIE 9.0 uses hardware acceleration by default it just can't scale otherwise than using a bicubic scaling.

In my experience, other browsers support smooth rescaling for years.

WebKit-based browsers may use nearest on images with heavy animated size. For static images it uses bicubic as expected.

Actions #4

Updated by Jean-Philippe Lang over 12 years ago

Just made a quick test with Firefox 14.

On the left, a bicubic resample of a screenshot. On the right, the same screenshot resampled by FF:

Doesn't seem to be the same bicubic resampling.

Actions #5

Updated by Jean-Philippe Lang over 12 years ago

On small images, the difference is not so obvious (but still visible with my FF).

An original 20x20 gravatar on the left, a 60x60 gravatar resampled at 20x20 by [your browser]:

Actions #6

Updated by Peter Leonov over 12 years ago

Yeap, you'r right for Firefox (Win) and Opera (Win and Mac) with large images. But for sane avatar sizes all go bicubic way.

Here is a set of screenshots of my gravatar scaled from 300px on the left, and 1300px on the right for different browsers on Mac and Win.

Use this code:

<style>
.ava { width: 150px; }
</style>

<img class="ava" src="http://www.gravatar.com/avatar/3ba04ac580b453fa6cc4457500d032c6?rating=PG&size=300&default="/>
<img class="ava" src="http://www.gravatar.com/avatar/3ba04ac580b453fa6cc4457500d032c6?rating=PG&size=1300&default="/>

Actions #7

Updated by Peter Leonov over 12 years ago

Jean-Philippe Lang wrote:

On small images, the difference is not so obvious (but still visible with my FF).

Yes, indeed! Glad to see you investigating client side quirks ;)

Actions #8

Updated by Jean-Philippe Lang over 12 years ago

Plus, the original 20x20 gravatar is 1.06 KB, the 60x60 is 3.04 KB.

Actions #9

Updated by Jean-Philippe Lang over 12 years ago

FWIW, Github uses only one gravatar size (140x140).

Actions #10

Updated by Go MAEDA over 10 years ago

+1
If this feature is implemented, Gravatar icons on Redmine become Retina Ready.

Actions #11

Updated by Toshi MARUYAMA over 10 years ago

  • Category set to UI
Actions

Also available in: Atom PDF