Page 1 of 1
Resizing A Image For Upload
Posted: Fri Feb 24, 2006 6:13 pm
by icesolid
I was wondering if it is possible to resize a image that has been sent from a form, and then upload it after it has been resized?
Right now my script just accepts the image file from a FILE input and uploads it. I want to resize the photo submitted first and THEN upload it.
Is this possible, if so how?
Posted: Fri Feb 24, 2006 6:28 pm
by feyd
nope.
Posted: Fri Feb 24, 2006 6:32 pm
by icesolid
So I would have to upload it first, and then pull it back out and resize it, and re-upload it all in one step?
Is it possible to set the size parameters of the file coming in before upload?
Posted: Fri Feb 24, 2006 7:29 pm
by feyd
Who said you'd have to reupload the file again? Upload the file, resize it, move it to where you want it. Done.
Posted: Fri Feb 24, 2006 9:58 pm
by nickman013
Posted: Sat Feb 25, 2006 3:02 pm
by icesolid
The reason I wanted to resize the photo first and then upload it is because I am uploading 20 photos at a time and they are all large images.
So if it was resized (considerably) then uploaded the load time on the submit process would be much faster.
Posted: Sat Feb 25, 2006 3:47 pm
by josh
You can resize them in photoshop by making an action (batch process), other then that there is no other way to do it other then having some kind of java applet or activeX control that does the actual image editing on the client side. Remember PHP can't see the image until it is fully uploaded..
Posted: Sat Feb 25, 2006 3:56 pm
by icesolid
What do you mean by an action in photoshop (batch process)?
If I was to use client side code such as javascript, where would I go for reasources on learning how to resize them?
Posted: Sat Feb 25, 2006 9:51 pm
by feyd
Java, not Javascript. Those are two entirely different languages.
Posted: Sun Feb 26, 2006 10:57 am
by icesolid
I understand that they are two different languages, either way where could I get help with my solution?
Posted: Sun Feb 26, 2006 11:44 am
by jayshields
Put it this way, unless you want to go through alot of trouble, you can't do it. It's not possible with PHP alone, it's a server side language. It can't handle any sort of file until it's on the server.
It would be a heck of a lot easier for you to just offer the user(s) a simple free image editting program and tell them to resize images before uploading to save time if they wish, any remotely experienced users would realise that uploading a larger file will take longer than a smaller file anyway.
If you are the only user, then as jspro2 said, Photoshops batch actions are a good idea for performing the same task on multiple files at once, such as resizing a bunch of images to the same dimensions.
If you don't care that your idea is more hassle than it's worth, as jshpro2 said (again) look into some sort of Java/Active X application to embed into your webpage, which will do the resezing client side.