javascript - Bad image rotation -


i have issue javascript when rendering image before upload in correct rotation. seems when render image witch have correct rotation on exif data browser doesn't use it.

users see different rotation between have on system on when image displayed on website javascript.

the code basic:

do know simple way correct rotation bug ?

lbemeraude.handleimage = function (f) {     if (f.type.match('image.*')) {         var reader = new filereader();         reader.onload = (function (file) {             return function (e) {                 var image = {};                 image.dataasurl = e.target.result;                 lbemeraude.renderimage(image);             };         })(f);         var image = reader.readasdataurl(f);     } }  lbemeraude.renderimage = function (image) {      var eimage = lbemeraude.createimgelement(image.dataasurl);     $('someelement').append(eimage);  };  lbemeraude.createimgelement = function (src) {     var image = document.createelement("img");     image.src = src;     return image; } 

thank attention.

what asking nothing new... check out: https://bugzilla.mozilla.org/show_bug.cgi?id=298619

that sucker opened in 2005 , has not been resolved yet. article old robust: http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/

but key part in there kinda far down notes browser not apply exif rotation when in context of html img tag, may honor when opening image in own tab.

so right no browser default, web apps seem getting value on server , serving down different assets.

but looks there hope if want hack in: accessing jpeg exif rotation data in javascript on client side


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -