On Mar 2, 3:26 am, thierryParen... @gmail.com wrote:
I am trying to load image from another domain and reading
content.
How an I get the Image array of bytes after loading it.
You can load it into the page, but AFAIK, it's not possible to get the
img bytes. Let us know if you figure out a way to do this. Once the
onload event fires, you can get the height and width, but that's about
it.
You could perhaps use an iframe or a script tag to get the data,
though. If you set the script's "type" tag to something funky before
setting the src, then the browser won't bother parsing it, and you
could then peek at the properties to see if you can get a glimpse at
the code inside. An iframe would work kind of the same way, but might
be even simpler. Just set the display style to "none", set the src,
and then view the response via contentWindow.c ontentDocument. innerHTML
once the load event has fired.
Or, you know, you could always just write a proxy that sits on your
server and allows you to pipe through via a curl call to specifically
allowed urls. Then you could use XHR like you oughtta ;)
--
Isaac Z. Schlueter
http://isaacschlueter.com