title: DOM Exception: SECURITY_ERR (18) when using getImageData
body: <p>I just started getting this error when I switched from using png images to SVG. The images are on the same server that I am running this code on -</p>
  
  <pre><code>function getLeftEdge(myImage) {
          var img = document.getElementById(myImage);
          var canvas = document.createElement('canvas');
          canvas.width = img.width;
          canvas.height = img.height;
          var context = canvas.getContext('2d');
          context.drawImage(img, 0, 0);
          var pixelData;
  
          for (var x = 0; x &lt; tmp[0]; x++) {
              for (var y = 0; y &lt; tmp[1]; y++) {
                  pixelData = context.getImageData(x, y, 1, 1);
  </code></pre>
  
  <p>So this shouldn't be a cross domain issue. I don't think. I created the SVG images using ImageMagick to convert the png images on a Linux machine at another domain. Could that cause this somehow? I can't see anything in the SVG file header that identifies where it came from.</p>
  
  <p>I found this, <a href="http://enable-cors.org/" rel="nofollow">http://enable-cors.org/</a>, about changing my server but I would really like to find a way to clean up the images because the program and images will be sent on to a customer to use.</p>
  
  <p>Any suggestions?</p>