LocalResizeIMG. js images uploaded under the iphone are rotated 90 degrees. How to Solve the Problem of LocalResizeIMG. js images uploaded under the iphone being rotated 90 degrees?
Reply content:
LocalResizeIMG. js images uploaded under the iphone are rotated 90 degrees. How can this problem be solved?
This is wherejs
Rotate images in source code
Var angle = ''; this. on ('change', function () {var file = this. files [0]; var URL = window. URL | webkitURL; var blob = URL. createObjectURL (file); var BinaryAjax = window. binaryAjax | '', EXIF = window. EXIF | ''; if (BinaryAjax & EXIF) {// get photo orientation and set angle BinaryAjax (blob, function (o) {var oExif = EXIF. readFromBinaryFile (o. binaryResponse), orientation = oExif. orientation; switch (orientation) {case 6: angle = radians ('90deg '); break; case 3: angle = radians ('180deg'); break; case 8: angle = radians ('270deg '); break ;}}) ;}// run the pre-function if ($. isFunction (obj. before) {obj. before (this, blob, file)}; _ create (blob, file); this. value = ''; // clear temporary data}); function radians (angle) {if (typeof angle = 'number') return angle; return {rad: function (z) {return z;}, deg: function (z) {return Math. PI/180 * z;} [String (angle ). match (/[a-z] + $/) [0] | 'rad '] (parseFloat (angle ));}