Hello dear community.
I am trying to create extract colors from images obtained from Flickr. All this works very well when I try to process these images in a canvas using getImageData ().
As described in WHATWG, loading an image into the canvas sets a flag, so you cannot bundle it. So my question is, does FLICKR CORS support?
<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);
}
});
</script>
I also tried to process the image, but this is a really difficult process (it took about 4 minutes to process 250 images).
If you have any clues, just ping me.
Enviroment: Mac OSX, HTML5, jQuery
source
share