NYCPHP Meetup

NYPHP.org

[nycphp-talk] Resize pictures before uploading

Anirudh Zala arzala at gmail.com
Tue Jul 10 07:19:00 EDT 2007


On Wednesday 20 Jun 2007 21:42:13 Nelly Yusupova wrote:
> Hello Everyone,
>
> I wrote a script that allows users to upload up to 10 photo files to the
> server.   The script automatically resizes the photos to the appropriate
> size.  The upload and resizing scripts are working perfectly.  The problem
> is that clients are uploading large photo files and it takes a long time to
> upload them.
>
> Is there a script or any way I can resize the pictures before uploading?
>
> Thank you in advance.
>
> Sincerely,
> Nelly Yusupova
> DigitalWoman.com
>  <mailto:nelly at digitalwoman.com> nelly at digitalwoman.com
> 917 603-9226 (phone)
>  <http://www.digitalwoman.com/> http://www.digitalwoman.com

There is no standard solutions for this problem. However you can use a 
technique called "background-transfer" or "early transfer" in which as soon 
as user moves to 2nd box to select 2nd picture for uploading, transfer of 1st 
image starts in background. You need to use Ajax for this.

Hence when user moved to last box or finally to upload button, 70% of images 
would have transferred in background. This saves lot of uploading time and 
user thinks that transfer of images went faster however in reality it is 
same.

Many large image, graphics, video sites use this technique to reduce large 
uploading time just by controlling the way of transfer.

Resizing images at client is not good solution even if it is possible to 
resize because then on server side you may have very limited image data to 
make further processing on them like printing, enhancing etc.

Thanks
 
Anirudh Zala



More information about the talk mailing list