This code below,
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#img_').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#inpFile").change(function () {
readURL(this);
});
shows image like this below(this is a 2 MB size image);
horizontal view on image file read
I have solved this problem with this code;
$('#inpFile').change(function (e) {
var file = e.target.files[0];
canvasResize(file, {
width: 300,
height: 0,
crop: false,
quality: 100,
callback: function (data, width, height) {
$("#img_").attr('src', data);
}
});
});
I post this file to generic handler then i save it to the file. The image saving to file right rotation but when i try to show them in codebehind with innerHtml it again displays horizontal. (Like this horizontal view on slider)
How can I solve this problem? (I have tested when the image size small no problem but if it s big then problem starts)