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....
Validation in image uploads ..Please help
Moderator: General Moderators
Re: Validation in image uploads ..Please help
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]
[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]