user1083071
user1083071

Reputation:

Does Flickr support CORS? SECURITY ERROR with getImageData

Hello dear community.

I'm trying to create extract colors from images fetched from Flickr. That all works really great to the point when I try to process that images in canvas with getImageData().

As described through WHATWG loading an image into canvas set a flag so you cannot maniplate that. So my question is does FLICKR support CORS?

<script type="text/javascript">

    var img= new Image;  
    var canvas = document.getElementById('canvas');
    var ctx = canvas.getContext('2d');  
            var src = "fetched-flickr-image-url";  
        img.crossOrigin = "Anonymous";          
        img.src = src;
        img.onload = function() {    
        ctx.drawImage( img, 0, 0 );  
        var image_data = ctx.getImageData(0, 0, 100, 100);//Throw the Security error        
            }         
          });

</script>

I also tried to do the image processing in but thats a really heavy process (took about 4mins to process 250 images).

If you have any clues just ping me.


Enviroment: Mac OSX, HTML5, jQuery

Upvotes: 5

Views: 1057

Answers (1)

Jason Davies
Jason Davies

Reputation: 4693

Not yet; see here for discussion.

They now appear to be sending CORS headers for images but with Access-Control-Allow-Origin: http://www.flickr.com, which isn't much help but at least they're sending the headers now.

Upvotes: 4

Related Questions