[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

Resize image locally javascript


Hi,

Is it possible to resize an image in javascript before make a post?

-> first prob. : open a local file (on client machine)
-> second prob. : resize image (make 2mb img become 2k image)

Let me know.
Thanks

S_D
0
system_down
Asked:
system_down
  • 2
  • 2
  • 2
2 Solutions
 
Raynard7Commented:
It is possible if you use something like an activex control - but as javascript's access to the file system is limited and does not have the necessary image manipulation functions it can not currently be done.
0
 
b0lsc0ttCommented:
system_down,

No.  The browser can't work with files that way on the local computer.  The only way to do it would be with some ActiveX object or similar component although I don't know one that will do what you want.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
system_downAuthor Commented:
thanks for ultra quickly reply,

I scare activeX objects aren't a good idea :(

I'm basically trying to help users uploading their images, it happens that they upload 2MB image and it is quite annoying.
It will be nice to resize the images for them so that the upload time is shorter.

Any other idea?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Raynard7Commented:
Hi,

Unfortunatley I had this problem before and the choice was either activex (which I personally do not like) or give your users a link to a program they can use to resize their images (found that those with broadband did not care - those with dialup used irfanfiew to batch resize their images and did not have a problem)
0
 
system_downAuthor Commented:

Okay, instead of activex I personally prefere an applet, even if it is not the best solution as well.

I hate browser limitations...
0
 
b0lsc0ttCommented:
Irfanview (http://www.irfanview.com/) is a good program.  You can recommend that they optimize images or resize them with a program before uploading.  An image compression program can also help.  However that is about all you can do if you don't want to provide and possibly develop an object.

The limitations can be frustrating but if the browser didn't have these limits there would be more abuses of it than legitimate uses.  I'm really glad for this limitation (browser can't access computer files).

bol
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now