I use javascript to read an large image and append to the document, the image is vertical, with the size of 3024 * 4032:
here was my code:
var image = new Image()
image.onload = function () {
var width = image.width
var height = image.height
document.body.appendChild(image)
console.log('width: ' + width, 'height: ' + height)
}
image.src = 'images/01vertical.jpg'
but the console.log was output:
width: 4032 height: 3024
and the image display horizontal:
Does anyone met this? and how can I fix it? Thanks!