|
exif_imagetype
Determine the type of an image
(PHP 4 >= 4.3.0, PHP 5)
exif_imagetype() reads the first bytes of an image and checks its signature.
exif_imagetype() can be used to avoid calls to other
exif functions with unsupported file types
or in conjunction with Return Values
When a correct signature is found, the appropriate constant value will be
returned otherwise the return value is ChangeLog
Predefined ConstantsThe following constants are defined, and represent possible exif_imagetype() return values: Table 86. Imagetype Constants
ExamplesExample 599. exif_imagetype() example<?php
See Also
Code Examples / Notes » exif_imagetype10-nov-2006 12:43
Seems to give a 'Read error' warning if the size of the file is very small (2 bytes). I think this is because it needs a min 3 bytes to determine the file type
tom
libexif can also be used to parse image info out of id3 tags: exif_read_data("mp3_with_2.4ID3TAGS, '', true, false); tilmauder
After looking for hours, I found a very good source for exif related programs here: http://drewnoakes.com/code/exif/index.html It lists exif specifications (pdf), a few good links to exif related stuff. The best source I have found in my quest to understand exif better for use in php based exif tools. |