Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Resize image locally javascript

Posted on 2006-11-12
6
Medium Priority
?
381 Views
Last Modified: 2012-05-05

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
Comment
Question by:system_down
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 750 total points
ID: 17926719
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
 
LVL 54

Assisted Solution

by:b0lsc0tt
b0lsc0tt earned 750 total points
ID: 17926720
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
 
LVL 6

Author Comment

by:system_down
ID: 17926735
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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 35

Expert Comment

by:Raynard7
ID: 17926797
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
 
LVL 6

Author Comment

by:system_down
ID: 17926810

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

I hate browser limitations...
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17926816
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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question