meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

support loading image from buffer in Node #28

Closed jesperp closed 12 years ago

jesperp commented 12 years ago

loadNode assumes first argument to Caman() is a string/path. Can we make it support Buffer as well? The underlying node-canvas supports this: https://github.com/LearnBoost/node-canvas#imagesrcbuffer

I want to be able to do something like this:

<mongo|redis|whatever>.getfile(query, function(err, buffer) {
    Canvas(buffer, function() {
        ...
    })
})

Comments on commit welcome, just made it as simple as possible

meltingice commented 12 years ago

Good suggestion, thanks!