javascript canvas toDataURL() different output on chrome and firefox


I'm drawing some shapes on a canvas and sending te toDataURL() output on a server which had to convert the base64 encoded string to an array of rgb elements. Using firefox it works fine, but if I use chrome the reconstructed image is slightly different.. I thought it was an error in the conversion script I used, but even with opera it works good (didn't tryied IE yet).. I checked then on the output of the toDataURL() and i saw it was very different, in particualr on chrome it was http://pastebin.com/guSiP6Jc while on firefox http://pastebin.com/vEDLwHRP... the firefox output seems more reasonable to me, because the canvas has a black backgorund with an orange square moving in it. the other strange thing is that if I use the encoded string as src of an image element, it works good both on FF and chrome (even exchanging the encoded string between the two browsers)...

Any ideas of why they have such a different behaviour, and how I can decode correctly the encoded string from chrome to get an rgb Array? THANKS!!!