AntoAPI (Anto Ajax Picture Info)
How does it work?
When you click on the "get info" button, the getImageInfo() function is called. This function uses Ajax to call the get_info.php script.
get_info.php returns an XML tree containing the info about the image.
When the XML tree is returned the informations are stored in a array and then displayed in the alert.
If all worked fine, the Array will contain the information as follows:
info[0]: date of creation
info[1]: size
info[2]: width
info[3]: heigth
info[4]: average red value
info[5]: average green value
info[6]: average blue value
This is just an example that shows how the informations are stored in a JavaScript array when the getImageInfo() function is called.
I'm sure you will want to do more interesting things with these informations than showing them in a dialog!
Here comes your creativity, you just have to include the files into your pages and use them as you want.
Warning!
You cant use this script to retrieve informations about images stored on other servers than the server that hosts the script.
Download
click here to download the script (only 2 source code files, archived in a .Zip file)
Suggestions
The average color values could be used for example to display the image in a rectangle with a background color similar to the image main color.
The height and width values could be used to change dinamically the size of the component that displayes the image.
Example code:
This source code is an example on how to include and use the script.