?
Solved

Resize image locally javascript

Posted on 2006-11-12
6
Medium Priority
?
376 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult 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…
Suggested Courses

765 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