Javascript image preview always in landscape mode bug -


i'm trying dinamically preview image in javascript before uploading it, got code here: preview image before uploaded

<input type="file" accept="image/*" onchange="loadfile(event)">  <img id="output"/>  <script>    var loadfile = function(event) {      var output = document.getelementbyid('output');      output.src = url.createobjecturl(event.target.files[0]);    };  </script>

it works fine, when load picture that's in portrait format, rotates automatically , sets landscape. how can prevent happening?

it's not rotating picture automatically. when tested it, it's showing me correct image , orientation.

you experiencing problem exif orientation of image not being honored browser.

i suggest open image in image editing software, photoshop, make sure it's in portrait, , save under new name.

try script again , should work.

if not, try image (a portrait image found on web).


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -