views:

644

answers:

2

I am looking for a way to create a hash for an image displayed on an XHTML page using Javascript.

+1  A: 

Yes, you can get it via XMLHttpRequest. Note that you would need to play various tricks see http://web.archive.org/web/20071103070418/mgran.blogspot.com/2006/08/downloading-binary-streams-with.html and http://stackoverflow.com/questions/833068/how-to-force-save-as-dialog-box-in-firefox-besides-changing-headers) to get the file as a binary.

Matthew Flaschen
Thanks, but I'd wish to access an already parsed bitmap data of an image file. Do you have any ideas?
webwise
No. The actual data should be cached, but you would have to reparse the image in JS.
Matthew Flaschen
You should probably stick with the XMLHttpRequest, it is your most likely solution.
Dustin Fineout
+1  A: 

On supported browsers you could use a canvas element to get at image data. Get started with this Mozilla article on pixel manipulation.

Paul Dixon
Thanks, but I need to support IE as well. Any ideas?
webwise