|
Posted by Sanders Kaufman on 11/16/06 20:15
Lorenzo Thurman wrote:
> Does anyone know how to validate a particular image type using PHP? If I
> have a file and I want to ensure that it is a jpeg, how would go about
> it? A sort of is_jpeg or is_gif is what I'm seeking.
> TIA
For each of the image specs (gif, tiff, jpg, etc)
the first few bytes identify what it is. If you can
binary read the first few bytes with PHP, then you
can get that info... and usually a lot of other
stuff (dimensions, pallet, (c), etc.)
[Back to original message]
|