Validation in image uploads ..Please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rakhi
Forum Newbie
Posts: 3
Joined: Mon May 19, 2008 11:07 pm

Validation in image uploads ..Please help

Post 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....
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Validation in image uploads ..Please help

Post 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]
Post Reply