Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load local image into browser using JavaScript?

Tags:

I'm currently developing a solution for a web-to-print, poster printing application.

One of features I'd like to include is the ability to 'edit' (crop/scale/rotate) a given image, before proceeding to order a poster of said image.

To avoid the requirement of the user uploading the image to a remote server before editing, I'd like to know the following:

Is it possible (using JavaScript) to load an image stored on the client machine into the browser / browser memory for editing, without uploading the image to a remote server? And if so, how is this done?

Thanks,

BK

like image 503
kaese Avatar asked Oct 22 '10 10:10

kaese


People also ask

How do you link an image in JavaScript?

createElement('a'); // setting the src attribute to the (hopefully) valid URI from above img. src = src; // setting the href attribute to the (hopefully) valid URI from above a. href = href; // appending the 'img' to the 'a' a. appendChild(img); // inserting the 'a' element *after* the 'form' element parent.


1 Answers

The image can be edited without the user needed to upload the image to the server.

Take a look at the link below. It can be done quite easily.

Reading local files using Javascript

like image 73
santhgates Avatar answered Oct 28 '22 05:10

santhgates