I am looking for a way to create a hash for an image displayed on an XHTML page using Javascript.
            Asked
            
        
        
            Active
            
        
            Viewed 5,071 times
        
    2 Answers
1
            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 How to force save as dialog box in firefox besides changing headers?) to get the file as a binary.
        Community
        
- 1
 - 1
 
        Matthew Flaschen
        
- 278,309
 - 50
 - 514
 - 539
 
- 
                    Thanks, but I'd wish to access an already parsed bitmap data of an image file. Do you have any ideas? – webwise Jun 10 '09 at 14:25
 - 
                    No. The actual data should be cached, but you would have to reparse the image in JS. – Matthew Flaschen Jun 10 '09 at 14:56
 - 
                    You should probably stick with the XMLHttpRequest, it is your most likely solution. – defines Jun 28 '09 at 12:46
 
1
            
            
        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
        
- 295,876
 - 54
 - 310
 - 348