Page 1 of 1

How to resize an image collected from a form

Posted: Wed Apr 01, 2009 1:39 pm
by lawillas
Hi....thanks for all the help rendered by you guyz on the last issue i posted....This time i'm trying to create a recruitment portal and i want jobseekers to upload their passport photograph....i'll want to resize the image they upload( regardless of the size ) to my database and after word retrieve it and dispalay it on top of their resume.Will be glad with any help.

Re: How to resize an image collected from a form

Posted: Wed Apr 01, 2009 2:31 pm
by jaoudestudios
Here is a image control (resize, rotate etc...) class which should help
http://www.forum.jaoudestudios.com/view ... f=13&t=183

Re: How to resize an image collected from a form

Posted: Thu Apr 02, 2009 9:03 am
by lawillas
I need 1 more thing.....is there an image function that returns to me the extension of the image...like gif or jpeg?

Re: How to resize an image collected from a form

Posted: Thu Apr 02, 2009 9:57 am
by pickle

Re: How to resize an image collected from a form

Posted: Thu Apr 02, 2009 1:22 pm
by jaoudestudios
That will get the image size, hence the name. To get the extension you could just take the last . (dot) and everything afterwards.

Re: How to resize an image collected from a form

Posted: Thu Apr 02, 2009 2:24 pm
by pickle
jaoudestudios wrote:That will get the image size, hence the name. To get the extension you could just take the last . (dot) and everything afterwards.
Actually, read the docs. getimagesize() will also get the type of image it is.

Just using the extension is not secure at all. It's trivial to rename MyNastyVirus.exe to MyNastyVirus.jpg.

Re: How to resize an image collected from a form

Posted: Thu Apr 02, 2009 11:50 pm
by jaoudestudios
Fair enough, I did not know that it would get the extension too. :)

Yes you are right, it is not secure just to use the extension.