I got this javascript function, which previews the input image (with the original size) to an input field.
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
$("#imgInp").change(function(){
readURL(this);
});
}
and the associated HTML:
<form id="form1" runat="server">
<input type='file' id="imgInp" />
<img id="blah" src="#" alt="your image" />
</form>
I got the code from this answer: Preview an image before it is uploaded
My question is if and how it is possible to change the resolution of the previewed image, I want to change only the resolution of the previewed image not the image itself.
Any ideas?