I use the input box on the website so that the user can take himself in the photo.
On iPad, iPhone, the resulting image is upside down. How can I easily determine if the user has used the camera so that I rotate the image using Javascript?
I use the image in Javascript canvas after.
I got this input field:
<div class="input-field">
<label>Choose image or take a picture :</label>
>input type="file" id="imageLoader" name="imageLoader" accept="image/*"/>
</div>
And in JS:
var imageLoader;
imageLoader = document.getElementById('imageLoader');
imageLoader.addEventListener('change', _handleImage, false);
function _handleImage( e ){
var reader = new FileReader();
reader.onload = function(event){
picture.onload = function(){
do_stuff( );
};
picture.src = event.target.result;
};
reader.readAsDataURL(e.target.files[0]);
}
source
share