20

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?

Hugo Gameiro
  • 615
  • 2
  • 7
  • 16

7 Answers7

15

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 :)

Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
develCuy
  • 576
  • 5
  • 14
  • I _heard_ that the quality of resized image is not good though, then what's the use! – Aklin Aug 31 '12 at 15:25
  • It is Open Source, so you can always improve it. i.e: compile imagemagick with Emscripten and you will get tons of options to improve image quality. – develCuy Sep 12 '12 at 19:56
10

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

Ady Levy
  • 101
  • 1
  • 3
4

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.

Tom
  • 3,507
  • 1
  • 29
  • 29
  • This project is no longer active, though is open source. It does however convert all images to JPG files on upload. A problem if you want to upload line-art type PNG files (as the quality is dramatically affected). – Chris Oct 18 '12 at 17:21
1

I'm using flash uploader from http://www.resize-before-upload.com, works just fine :)

Paul
  • 11
  • 1
1

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.

DavGarcia
  • 18,540
  • 14
  • 58
  • 96
1

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...

Scott Evernden
  • 39,136
  • 15
  • 78
  • 84
0

The latest version of SwfUpload does client-side image resizing (using Flash). A pretty useful tool, although extras like displaying upload progress can get a little fiddly.

http://code.google.com/p/swfupload/

Simon East
  • 55,742
  • 17
  • 139
  • 133
  • 1
    It looks as though the project may be dead. It hasn't been updated since March 2010, v2.5 is a 'beta 3' and there are a number of open issues - see http://code.google.com/p/swfupload/issues/list. – Chris Oct 18 '12 at 19:28