title: Failed to execute 'getImageData' - The canvas has been tainted by cross-origin data
body: <p>I'm interested in using <a href="https://github.com/jwagner/smartcrop.js/" rel="nofollow">smartcrop.js</a> with some user uploaded images on my site. A user can upload an image of any size to my Amazon S3 bucket. This image is then associated with the user and when they visit their profile they can see the images cropped nicely. When I try and perform some sort of manipulation with smartcrop on an image element I get the error:</p>
  
  <p><code>smartcrop.js:282 Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.</code></p>
  
  <p>This can be reproduced with the following steps:</p>
  
  <pre><code>var image = new Image();
  image.src = "https://freelancestudent.s3.amazonaws.com/files/google.png"
  SmartCrop.crop(image, {width: 100, height: 100}, function(result){console.log(result);});
  smartcrop.js:282 Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.
  </code></pre>
  
  <p>I've checked the CORS configuration editor in my S3 control panel and it looks like this:</p>
  
  <pre><code>&lt;CORSConfiguration&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
          &lt;AllowedHeader&gt;Authorization&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>My understanding was that <code>&lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;</code> should mean this problem shouldn't exist? I've read a solution that I could save the image to the server to display but I wish to keep my static files and the production server separate. Any ideas?</p>