Page 1 of 1

Validation in image uploads ..Please help

Posted: Mon May 19, 2008 11:14 pm
by rakhi
Hi all,

Iam doing the PHP image uploads. Here I need the validation of images, ie; Progressive jpegs and animated gifs are not permitted. Could any body point out how can I differentiate the types, I gets the type 'image/jpeg' for both progressive jpegs and normal jpegs, also the same issue raises with animated gif.

Thanks for any help..
Rakhi....

Re: Validation in image uploads ..Please help

Posted: Mon May 19, 2008 11:21 pm
by califdon
As far as I know, the only way you can tell is to examine the header inside the file, so I'd say it would require a fairly sophisticated bit of code, and of course, a knowledge of how that is coded. I'm sure that's publicly available in the standards for jpeg and gif, but I don't know what they are.

[Edit: I found 2 references that might help: http://en.wikipedia.org/wiki/JPEG#Syntax_and_structure and
http://wiki.mozilla.org/APNG_Specificat ... trol_Chunk]