I have a place for preview to show a preview of the image before downloading, the problem is when you select an image from your phone, it appears on the side. How can I rotate an image if it needs to be rotated?
my javascript to show a preview:
<script type="text/javascript">
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]);
}
}
</script>
and html
<img src="images/Your_Picture_Here.png" alt="" title="" class="prod_image" id = "blah"/>
source
share