views:

522

answers:

7

I would like to know if it is technically possible to resize an image at a client-side with javascript (really resize, not just change width and height). I know it's possible to do it in flash but I would like to avoid it if possible. Is there any open source algorithm somewhere on the web?

A: 

You would need to perform the resize at the server side, unfortunately.

If it were possible through JavaScript (which I don't think it is), you would almost certainly have cross-compatibility issues.

Jamie Chapman
A: 

I haven't seen that javascript can resize images

I googled a little and found this topic http://stackoverflow.com/questions/973591/resizing-images-on-client-side

Hmm... read more on the thread, and it seems to be flash solution.

Wai Wong
A: 

Perhaps with the canvas tag (though it's not portable). There's a blog about how to rotate an image with canvas here, I suppose if you can rotate it, you can resize it. Maybe it can be a starting point.

See there also.

David V.
A: 

Hi there. It is possible to do using the HTML5 canvas tag. As others have mentioned, this only works on standards compliant browsers.

There may be some other way to resize an image using IE, but that wouldn't be open source.

If you're interested in the canvas solution, let me know, and I'll show you.

robert
show us please.
Shawn Mclean
A: 

It it will be possible with html5.

For now, you can use Silverlight to do it. Here is a great starting point.

http://www.codeplex.com/SilverlightFileUpld

Mendy
A: 

This is promising:

http://www.resize-before-upload.com/

Matt Newman
A: 

http://www.plupload.com

HTML5: Image resizing is only possible on Firefox 3.5+ and only at a fixed quality. WebKit/Opera doesn't support direct data access to the selected files.

The rest it handles with Flash.

cemregr