Solved

Resize image locally javascript

Posted on 2006-11-12
6
369 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 250 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 250 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

734 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