title: Cross-origin data in HTML5 canvas
body: <p>I'm loading an image in js and draw it into a canvas. After drawing, i retrieve imageData from the canvas:</p>
  
  <pre><code>var img = new Image();
  img.onload = function() {
      canvas.drawImage(img, 0, 0);
      originalImageData = canvas.getImageData(0,0,width, height)); //chrome fails
  }
  img.src = 'picture.jpeg';
  </code></pre>
  
  <p>This works perfectly both in Safari and Firefox, but fails in Chrome with the following message:</p>
  
  <blockquote>
    <p>Unable to get image data from canvas because the canvas has been tainted by cross-origin data.</p>
  </blockquote>
  
  <p>The javascript file and the image are located in the same directory, so i don't understand the behavior of chorme.</p>