upload image - resize then save

T

Tim T

Hi,
Could someone please point to to a tutorial / code for dynamically resizing
images on upload, THEN saving to disk on the webserver.
I need users to be able to upload images to my server, but they will not be
aware of optimising graphics for the web, if someone uploads a 300k 640x480
jpeg for example, i need to be able to shrink it down to a - say 400x300 65k
file BEFORE saving to my webserver.
I have been looking on the web and have found plenty of code for resizing
images and dynamically outputting an optimised images from heavy images that
reside on the server, but i need to shirnk it after getting it from the user
as an input stream before saving it to disk to save disk space.

in summary:
user uploads 600k jpeg via file field in web form
code then shrinks this down (may shrink physically or reduce quality or
both)
saves to disk a 65 k jpeg to disk on the webserver.

(note that i'm not interested in the GetThumbNailImage method for jpegs as
this produces too small an image)

I'm sure there is a tutorial out there for this, or if someone has code to
post here to this that would be fantastic

Thanks for any help.

Tim..
 
T

Tim T

Thanks for your reply, but that doesn't really help... The thumbnails are
too small.
I have done a workaround where i am saving the uploaded image to disk first,
then resizing it and saving a smaller/optimised version.
still interested if anyone has seen a tutorial to do this in one step, or if
someone has code can they post it or email me
Thanks

Tim
 
Joined
Aug 17, 2006
Messages
1
Reaction score
0
same Issue

Hi Tim,

I'm having the same issue and can't find enything either. Any chance you could post your workaround? Did you set it up as a function?

Thanks,

Stu

Tim T said:
Thanks for your reply, but that doesn't really help... The thumbnails are
too small.
I have done a workaround where i am saving the uploaded image to disk first,
then resizing it and saving a smaller/optimised version.
still interested if anyone has seen a tutorial to do this in one step, or if
someone has code can they post it or email me
Thanks

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top