Image Uploading

4 views
Skip to first unread message

dominiek

unread,
Aug 2, 2010, 12:53:33 PM8/2/10
to Twitter Development Talk

Hi there,

My name is Dominiek ter Heide and I have a little gimmicky project
called Blinkly, slick profile image overlays: http://blink.ly/

Ever since about a month ago I've been experiencing some problems with
image uploading through the REST API. I managed to fix this (meaning
less failures) by using the V1 API, other developers with this problem
should look into this!

However, every time I upload an image through the API or through the
website even, it scales it down in a strange way. When the aspect
ratio wasn't squared, it used to crop it in a smart way. Right now
however, black borders are added to all uploaded images. E.g.
http://a0.twimg.com/profile_images/1093873780/blink_23.jpg

Are the Twitter devs changing this back to the smart cropping like it
used to? If so, I will not bother in adjusting my backend and cope
with the glitch for now.

Sincerely,

@dominiek

Taylor Singletary

unread,
Aug 2, 2010, 1:19:27 PM8/2/10
to twitter-deve...@googlegroups.com
Hi @dominiek,

Here's that state of image uploading and the Twitter API (and website):

Up until very recently, image upload via the API or on the site was a bit of a crap shoot -- it was a synchronous process, and if our servers couldn't process the image quickly enough or ran into any problems, it would throw a 500 error. My own personal estimate was that about 3/5ths of the time you tried to perform an image upload operation, you'd get an error.

Recently, an engineer began refactoring our image upload process so that it was an asynchronous process. This means that in most cases, we'd acknowledge an image upload as it was received, and unless there was anything particularly problematic about the upload, we'd return a 200 status code, put the image in a queue, and after processing, update the image on record. This means from an API perspective, you now need to check back later to see what the new image URL is. We're still working through these implications, but the move to an async model was a requirement to be able to service these uploads at all.

Now, meanwhile when the async service was developed, the image manipulation libraries used were also changed. This is what's resulted in the "black bar" effect you've noticed.

Long story short, we're continuing to iterate on this issue and tweak the image manipulation routines we are using. I'd recommend when uploading images that you assure they are as square as possible before upload, but overall, this is something we (Twitter) need to fix so that its behavior is more deterministic.

Taylor

dominiek

unread,
Aug 2, 2010, 1:34:22 PM8/2/10
to Twitter Development Talk

Ah, that makes sense, I'll wait for the black bar effect fixes then.

Thanks!

On Aug 2, 7:19 pm, Taylor Singletary <taylorsinglet...@twitter.com>
wrote:

Andrew W. Donoho

unread,
Aug 3, 2010, 7:58:37 AM8/3/10
to twitter-deve...@googlegroups.com, Taylor Singletary

On Aug 2, 2010, at 12:19 , Taylor Singletary wrote:

> Long story short, we're continuing to iterate on this issue and tweak the image manipulation routines we are using. I'd recommend when uploading images that you assure they are as square as possible before upload, but overall, this is something we (Twitter) need to fix so that its behavior is more deterministic.

Taylor,

I really want the black bars taken out of the images. If Twitter must "squarify" the image, please use transparent pixels. (I place these images on top of black, white and colored backgrounds.) I need the Twitter user's image layout to come through. (I use, and cache, the high resolution version of these images.)

Thank you for your continued excellent support.

Anon,
Andrew
____________________________________
Andrew W. Donoho
Donoho Design Group, L.L.C.
a...@DDG.com, +1 (512) 750-7596

"We did not come to fear the future.
We came here to shape it."

-- President Barack Obama, Sept. 2009

Taylor Singletary

unread,
Aug 3, 2010, 10:01:39 AM8/3/10
to Andrew W. Donoho, twitter-deve...@googlegroups.com
No one likes the black bars. We're working on it.

Taylor
Reply all
Reply to author
Forward
0 new messages