Solved

Resize image locally javascript

Posted on 2006-11-12
6
359 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now