Comments: Facebook Image-to-Email

This explains why it's a bitmap:
http://www.25hoursaday.com/weblog/2007/08/21/FacebookTheSocialGraphRoachMotel.aspx

Posted by RichB at September 10, 2007 9:43 PM

Appears to be Tahoma at 11px with font-color set to rgb(50,50,50). Tried rendering your email address using PIL but the kerning and anti-aliasing wasn't identical to your supplied image, although the shapes of the @ and other letters were pretty spot on.

I had the idea to pre-generate the various glyps (including two-character glyphs, if any), make it so the image is 16 pixels high (there's enough whitespace) and use two columns of pixels as a Uint32 (white=0, the rest=1) and then build a "scan trie" of sorts in Python and dump it using JSON. Would allow for a compact representation usable from JS, even if compactness isn't necessary.

Facebook runs on PHP which uses GD for image generation IIRC, but I haven't got it installed to see if it renders things differently. One could, of course, collect a bunch of email images and run the test off that, but it's not as easy to automate things then.

Maybe I'm just over-thinking it, haven't eaten dinner... Does sound like a fun little project, though.

Posted by Fredrik at September 10, 2007 10:26 PM

I tried mucking around with it for a bit, but I was getting a null return for getImageData every time.

Posted by Christopher Finke at September 10, 2007 10:33 PM

I believe that was added after some were scraping email addresses. Since most people befriend anyone who asks, it's easy to gain a nice amount of data. Email address being the most valuable. Not such a bad move considering their business model is largely to not fall into the privacy trap that MySpace had. So far they have done pretty well.

Posted by Robert Accettura at September 11, 2007 12:04 AM

Oooh and if someone could write a captcha solving algorithm too :-) it's got to the point where I can't read them anymore.

monk.e.boy

Posted by monk.e.boy at September 11, 2007 8:13 AM

I have a truly marvelous solution to this problem which this comment box is too narrow to contain. I'll put it up on my blog shortly.

Posted by Christopher Finke at September 11, 2007 3:01 PM

Here's the writeup of my solution: http://www.chrisfinke.com/2007/09/11/convert-facebook-e-mail-images-to-actual-e-mail-links/

Definitely a fun problem to solve.

Posted by Christopher Finke at September 11, 2007 4:05 PM

Jolly clever. Nicely done.

You could register a click handler for the images and do the conversion on-demand, to avoid slowing down any page loads. And possibly add a pref for choosing between on-demand and on-load operation. For version 1.1 or whatever ;).

Posted by Fredrik at September 11, 2007 5:25 PM

Chris: Most impressive! Thank you very much indeed. I wonder if they'll try and break the technique. I hope not.

Fredrik's idea is possibly a good one; I guess it depends on what the performance impact is. Can you use document.images to speed things up, if you aren't already?

Posted by Gerv at September 12, 2007 8:19 PM

If Chris' solution can do general image-to-text conversions, it would be extremely useful to add to the spam detection in Thunderbird. You wouldn't even need to get the conversion exactly right; e.g. just finding "Vioxx" or other keywords in the image would be enough to flag the email as likely being SPAM.

Posted by James Napolitano at September 13, 2007 5:35 AM

@monk.e.boy

"Oooh and if someone could write a captcha solving algorithm too :-) it's got to the point where I can't read them anymore."

It's been done. One of the members of theReformed (http://www.thereformed.org) wrote one and published it about a year ago.

Posted by BT Clemson at September 14, 2007 1:29 PM