Python Substitute for PHP GD, Resizing an image on the client side

B

brahmaforces

Hi Folks,

I am using cherrypy and python. I am trying to get a user profile
image to resize on the client side before uploading to the server. PHP
has a gd library that does it it seems. Has anyone done this in a
python environment without uploading to the server?
 
U

Uwe Schmitt

Hi Folks,

I am using cherrypy and python. I am trying to get a user profile
image to resize on the client side before uploading to the server. PHP
has a gd library that does it it seems.

php works on the client side ?? are you sure ?
Has anyone done this in a
python environment without uploading to the server?

if you resort to resizing on the server side, you can
use PIL.

Greetings, Uwe
 
D

Diez B. Roggisch

brahmaforces said:
Hi Folks,

I am using cherrypy and python. I am trying to get a user profile
image to resize on the client side before uploading to the server. PHP
has a gd library that does it it seems. Has anyone done this in a
python environment without uploading to the server?

Everything PHP is server-side. And displaying images is *always* done
through uploading and then displaying it.

The resizing is done using JavaScript, and then communicating back the
selected rectangle to the server - *then* GD or whatnot (PIL,
ImageMagick) are used to resize the image.

Diez
 
B

brahmaforces

Hi Everyone,

Thanks for your responses. Sorry I should have been clearer in my
question. Yes PHP is server side, and it seems that all image
processing using GD or ImageMagicks etc happens on the server.
Therefore Diez's suggestion of using javascript to select a rectangle
on the client side would be the best option and then upload this small
selection to the server and then process there.

Does anyone have any code that does the javascript "selecting the
rectangle bit" and uploading to the server. Also incidentally is ftp
or put the recommended way to go for uploading the reduced image to
the server?

Thanks...
 
D

Diez B. Roggisch

Does anyone have any code that does the javascript "selecting the
rectangle bit" and uploading to the server.

I've based my work in this field on some freely available JS, but don't know
what it was called. Google is your friend here.
Also incidentally is ftp
or put the recommended way to go for uploading the reduced image to
the server?

In the same way any other uploading is done in browsers when a website is
involved: using HTTP POST. Use the <input type="file">-tag, and make sure
the server-side will store a transmitted file properly. Frameworks such as
TurboGears (1 or 2) and Django will do that for you.


Diez
 

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,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top