getImageData,, dox

21 Jan 2011 | By Alex Young | Tags jsonp network documentation


$.getImageData by Max Novakovic provides pixel level access to images from any domain. It uses a server-side component with JSONP requests that base64 encodes the images and returns them to the client for further Canvas processing.

There are PHP, Python, and Node examples in the getImageData/server-examples directory

Max told me that David Desandro has written a plugin based on this project called Close Pixelate (which we’ve featured previously on DailyJS). by Thomas Rampelberg is a library that aims to get around cross-domain request limitations, as well as JSONP limitations. For example:

janky({ url: "", 
        data: { foo: 'bar', baz: [1,2,3] }, 
        success: function(resp) {
          console.log('server responded with: ' + resp);
        error: function() {
          console.log('error =(');

That example basically replicates a JSONP result (but you’ll notice that there’s actually errors that occur, no firing requests into the ether)

There’s a demo and documentation. There are currently Tornado and Google App Engine servers.

Dox Updates

TJ Holowaychuk updated dox to 0.0.4, which includes a few fixes and a small patch I put in there so an introduction markdown file can be included instead of using the --desc option.

I think dox is a cool little project, so I encourage you to try it out and submit your own tweaks and improvements. GitHub makes open source collaboration easy (fork, clone, push, pull request), so you’ve got no excuses not to help out!

blog comments powered by Disqus