How to resize an image collected from a form
Moderator: General Moderators
How to resize an image collected from a form
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.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to resize an image collected from a form
Here is a image control (resize, rotate etc...) class which should help
http://www.forum.jaoudestudios.com/view ... f=13&t=183
http://www.forum.jaoudestudios.com/view ... f=13&t=183
Re: How to resize an image collected from a form
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
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to resize an image collected from a form
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
Actually, read the docs. getimagesize() will also get the type of image it is.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.
Just using the extension is not secure at all. It's trivial to rename MyNastyVirus.exe to MyNastyVirus.jpg.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to resize an image collected from a form
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.
Yes you are right, it is not secure just to use the extension.