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