Bigger avatar images for users/profile_image/twitter ?

已查看 1,286 次
跳至第一个未读帖子

Guillaume Gaubert

未读,
2011年3月6日 09:13:332011/3/6
收件人 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

未读,
2011年3月6日 12:28:402011/3/6
收件人 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

未读,
2011年3月6日 15:43:242011/3/6
收件人 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

未读,
2011年3月6日 23:20:502011/3/6
收件人 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.

未读,
2011年3月7日 12:22:292011/3/7
收件人 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

未读,
2011年3月24日 12:51:322011/3/24
收件人 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

未读,
2011年3月30日 06:43:092011/3/30
收件人 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
回复全部
回复作者
转发
0 个新帖子