Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
|
The "solution" you think is correct would only get the filename extension NOT the image format. So archanapatel and you are both wrong.
|
Absolutely!
Try to rename an jpg image to gif, and to open it in firefox. It will be displayed correctly.
A file is defined by it's content, not it's extension (except for window, but they surely will say that's a feature, and not a bug).
Linux/osx systems use what is called "the magic file", which gives content pattern and signatures to determine the mime type of a file based on it's content and not it's extension.
getimagesize() does exactly that; it parse the content of the file to determine it's mime type and dimensions.
__________________
Only a biker knows why a dog sticks his head out the window.
|