How to recognize an image file format using its contents?
If a Image file is of format .png then it will contain ‰PNG , at the beginning of the file. (when read in Text mode) If a Image file is of format .bmp then it will contain BM , at the beginning of the file. (when read in Text mode) I know that Image formats contain text (data) of certain size (bytes) in the beginning of the file, which is used as metadata of the Image file? My Questions are:- Is this behavior same in all image file formats (or formats in general)? Could a image file ( of no extension ) be recognized just using this data? Is there information available on how this metadata is