Javascript-LocalResizeIMG.js in iphone upload pictures Rotate 90 degrees, how to solve

Source: Internet
Author: User
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 wherejsRotate 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 ));}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.