Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash upload image resize client side

Does anyone got an ideia on how to get client side image resize using flash.

Example: Client chooses an image with 1200x800 and before it uploads it flash will turn it into half of it or something.

Any thoughts?

like image 959
Hugo Gameiro Avatar asked Jan 10 '09 15:01

Hugo Gameiro


5 Answers

Plupload is Opensource, has good documentation and supports multiple platforms, including Gears and HTML5!

http://www.plupload.com/index.php
http://www.plupload.com/example_all_runtimes.php

Ah, yes, it supports resizing images BEFORE uploading. The closest option to aurigma, but for free :)

like image 111
develCuy Avatar answered Nov 18 '22 17:11

develCuy


take a look at the script i wrote : image resizing at client side

like image 10
Ady Levy Avatar answered Nov 18 '22 17:11

Ady Levy


http://www.shift8creative.com/projects/agile-uploader/index.html

I just finished this little project - free to use. It won't really allow the end user to select the size, but you can pass a max width and max height constraint. Maybe you can make multiple pages/embeds with different options.

like image 4
Tom Avatar answered Nov 18 '22 15:11

Tom


Silverlight, ActiveX and Java can do this completely client-side. If you have to use Flash you are going to need to use Flash 10 which isn't prevalent quite yet. Here is an example on uploading an image to Flash then resizing it on the client from Flash Cafe.

Other options in Flash 8 or 9 would involve a server-side resizing script, defeating the purpose in most scenarios.

like image 1
DavGarcia Avatar answered Nov 18 '22 16:11

DavGarcia


You need create a transformation matrix, then draw the original bitmap into a new one using it. Here's the idea in something i am just typing in and have not tested:

function resize(obm:BitmapData, scale:Number): BitmapData {
   var resizeMatrix:Matrix = new Matrix();
   resizeMatrix.scale(scale, scale);

   var rbm:BitmapData = new BitmapData(obm.width * scale, obm.height * scale);
   rbm.draw(obm, resizeMatrix);

   return rbm;
}

I make no claims about the quality of the result, however. I think I remember trying this in the past, not liking the result, and punting...

like image 1
Scott Evernden Avatar answered Nov 18 '22 15:11

Scott Evernden