IOS Camera Issues

Source: Internet
Author: User

Sometimes it's normal to have problems on the iphone. After repeated testing found that the problem in the use of the iphone camera photos taken, these photo size is 3264x2448, but in fact the size of the picture is 2448x3264, width and height is exactly the opposite, and then I took the photo to the computer, it is true size should be 2448x3264. The reason is that the starting point of the image taken by the iphone is the lower left corner of the screen, so the width and height are reversed.

The following is an image upload by MUI photo function, crop images to judge.

Camera operation function GetImage () {Plus.camera.getCamera (). Captureimage (function (path) {Plus.io.resolveLocalFileSystemURL (Path, function (entry) {var path = Entry.tolocalurl (); var filename = entry.name;goshowimg (path, filename,1);}, Function ( e) {plus.nativeUI.toast ("read photo file Error:" + e.message);}), function (e) {}, {filename: "_doc/camera/", Index:1});} Album Selection function galleryimg () {Plus.gallery.pick (path) {var filename = ' images.jpg ';//alert (' Path: ' + path '); Goshowimg (path, filename,0);}, function (e) {console.log ("deselect Picture");}, {filter: "image"});

  

Jump to Crop page function goshowimg (path, Filename,camera) {//alert (' I want to jump '); Console.log (' Camera: ' + camera ') var image = new Image (); image.src = Path;mui.openwindow ({url: ' clip_img.html ', id: ' clip_img.html ', Extras: {path:path,filename: Filename,idname: ' goods_add.html ', camera:camera},show: {autoshow:false}});

  

Get the width of the picture and screen, as well as the proportional var imgtemp = new Image (); imgtemp.src = Img.src;var Imgwidth;var imgheight;var proportion;var Displaywi DTH = Plus.display.resolutionwidth;var system = plus.os.name;if (System!== ' Android ' && parseint (camera) ==1) { ImgWidth = Imgtemp.width;imgheight = imgtemp.height;proportion= getproportion (imgheight, displayWidth);} Else{imgwidth = Imgtemp.width;imgheight = Img.height;proportion = Getproportion (ImgWidth, displayWidth);}

  

Img.setattribute ("width", plus.display.resolutionWidth);

calculate the proportions of the picture and display function getproportion (IMGW, displayw) { return IMGW /displayw; }

  

IOS Camera Issues

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.