Bigger avatar images for users/profile_image/twitter ?

1,281 views
Skip to first unread message

Guillaume Gaubert

unread,
Mar 6, 2011, 9:13:33 AM3/6/11
to Twitter Development Talk
Hi !

I want to use users/profile_image/twitter to get the picture of a
Twitter account. But I've seen the biggest size allowed is 73*73px. Is
there a way to get the original picture or a bigger one ?

Thank you,
Guillaume Gaubert.

Randolph Estebat

unread,
Mar 6, 2011, 12:28:40 PM3/6/11
to twitter-deve...@googlegroups.com

Hi -- im not sure what you specifically want to do but if are to show it in a page, just set the img width and height to your preference.



--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk



--
Randolph Estebat

Guillaume Gaubert

unread,
Mar 6, 2011, 3:43:24 PM3/6/11
to Twitter Development Talk
Thank you for your response. But if I do that I get a pixelated and
blurry picture.

On Mar 6, 6:28 pm, Randolph Estebat <raeste...@gmail.com> wrote:
> Hi -- im not sure what you specifically want to do but if are to show it in
> a page, just set the img width and height to your preference.
>
> On Sun, Mar 6, 2011 at 10:13 PM, Guillaume Gaubert
> <apocalypso...@gmail.com>wrote:

@IDisposable

unread,
Mar 6, 2011, 11:20:50 PM3/6/11
to Twitter Development Talk
> I want to use users/profile_image/twitter to get the picture of a
> Twitter account. But I've seen the biggest size allowed is 73*73px. Is
> there a way to get the original picture or a bigger one ?

Avatars come in three sizes:

mini = 24x24
normal = 48x48
bigger = 73x73
reasonably_small = 128x128

The last one only started being used with #NewTwitter so unless
someone has uploaded an avatar since then, you'll get the "bigger" one
instead. To get the alternate sizes, just replace the "_normal" with
the desired size. For my avatar these are the urls:

http://a3.twimg.com/profile_images/361706538/mk1_mini.jpg
http://a3.twimg.com/profile_images/361706538/mk1_normal.jpg
http://a3.twimg.com/profile_images/361706538/mk1_bigger.jpg
http://a3.twimg.com/profile_images/361706538/mk1_reasonably_small.jpg

Since sometimes people change the avatar and the one you might have on
file is now dead, I use spiurl as a backup source for images
http://code.google.com/p/spiurl/ which downloads and caches images
from Twitter and runs on google's AppSpot (you can clone your own if
you want control) The SPIURLs look like this:

http://purl.org/net/spiurl/IDisposable/normal

I've got it doing automatic fallback like this (and handling error
from there with a fallback to my own locally cached default images):

<img alt="IDisposable" width="48" height="48" src="http://a3.twimg.com/
profile_images/361706538/mk1_normal.jpg" title="IDisposable"
onerror="avatarOnError(this, 'normal');">

// Common.js
// must be setup very early to guarantee it is available before any
images try loading.
avatarOnError = function(img, size) {
var profileName = img.title;
size = size || "normal";
img.src = 'http://purl.org/net/spiurl/' + profileName + '/' +
size;
img.onerror = function() {
this.onerror = undefined;
this.src = '/Assets/images/twitter/default_profile_' +
Math.floor(Math.random() * 7) + '_' + size + '.png';
}
}

Ken D.

unread,
Mar 7, 2011, 12:22:29 PM3/7/11
to Twitter Development Talk
> Avatars come in three sizes:
>
>         mini = 24x24
>         normal = 48x48
>         bigger = 73x73
>         reasonably_small = 128x128
>
The original seems to be available at
http://a3.twimg.com/profile_images/361706538/mk1.jpg

Julien C

unread,
Mar 24, 2011, 12:51:32 PM3/24/11
to Twitter Development Talk
Yes, but it's not square, which I don't like. I've got the same
problem with Facebook, actually: the square version of the profile pic
is tiny.

Robert McGovern

unread,
Mar 30, 2011, 6:43:09 AM3/30/11
to Twitter Development Talk
On Mar 7, 7:22 pm, "Ken D." <k...@cimas.ch> wrote:
>
> The original seems to be available athttp://a3.twimg.com/profile_images/361706538/mk1.jpg

Are we actually allowed to use the "original" version? (Taking
profile_image_url and trimming out the _normal) I'd certainly like to
be able to use something a touch larger than 73x73 that is currently
the largest documented. Its not the prettiest on a retina display :)

The originals are certainly variable in size, I've seen 256x256,
375x500, 500x375, 500x500, 500x667 in my sampling of 10 (just going
via Twitter.com and clicking on peoples avatars).

Rob
Reply all
Reply to author
Forward
0 new messages