Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Upload and resize image on the fly

images php coding issues or problems here.

Moderators: macek, egami, gesf

Upload and resize image on the fly

Postby ymangitu » Thu Jun 30, 2005 6:29 am

Hi, I'm building my own PHP photo album and wondering if there's any way to upload and resize an image on the fly? This means not having to upload the entire image size. For example, if I'm about to upload a 3000x2000 pixels image @ 3MB, can I convert that image ON THE FLY during upload to let's say 800x600 ? If this is possible, then users don't have to wait the entire time to upload a big image and then resize it on the server. Thanks in advance.

Yohanes
ymangitu
New php-forum User
New php-forum User
 
Posts: 2
Joined: Thu Jun 30, 2005 6:25 am

Postby Alexej Kubarev » Thu Jun 30, 2005 6:42 am

im affraid you willh ave to upload it first and thenwork with it..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby ymangitu » Thu Jun 30, 2005 3:06 pm

Since the resizing must be DONE during or before the upload, then I guess it must be done on client-side, am I right? Can I use javascript or some other client-side programming to do this? I really don't want to waste time uploading full size images only to resize them on the server, it's way too much time and bandwidth. Any suggestions? Thanks.

Yohanes
ymangitu
New php-forum User
New php-forum User
 
Posts: 2
Joined: Thu Jun 30, 2005 6:25 am

Postby gesf » Thu Jun 30, 2005 4:09 pm

hummm ymangitu, Alexei is right! It must be done on server-side.
A great idea is to compress it somehow and your script will de-compress it (sorry, don't know how to say it :p)
and resize it.

Sounds good ?
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby Alexej Kubarev » Thu Jun 30, 2005 10:40 pm

using compression before uploading is a good idea but will most probably require actions from the user
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby gesf » Fri Jul 01, 2005 8:20 am

Hunn... didn't thought about that!
I'm affraid there's nothing to do about the upload time of large files.
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby ruturajv » Thu Jul 14, 2005 8:05 pm

you probably need a java applet for your purpose.
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby php-vikas » Mon Aug 22, 2005 8:48 pm

I dont think that it is possible to resize a image on the fly without uploading the image on the server. You must have to upload the image on the server before resizing.






Vikas
vikas@enablingbiz.com
http://www.enablingbiz.com
http://www.e2webhosts.com
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby Alexej Kubarev » Wed Aug 24, 2005 8:13 am

even with flash you will have to upload the image temporarly...then resize it..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.