我正在开发一个应用程序在phonegap中,并具有使用Ipad相机捕获照片的功能,它的工作原理和所有照片在服务器上正确保存。唯一的问题是它们在服务器上保存时旋转了90度。从Ipad捕获的照片将被倒置在服务器上
现在,我试图存储在图书馆的照片相同的事情,他们上传,因为它是在服务器上,所以我认为问题是与ipad照片捕捉过程。任何人都可以帮助我找到解决这个问题的方法。是Ipad的正常行为还是我在代码中弄错了?
我已经使用以下功能照片功能
//Capture Photo either from camera or IPAD library
function capturePhoto(source){
var deferred = $q.defer();
//When source == 1 than from Photo Library
var cameraOptions = { quality: 70, destinationType: Camera.DestinationType.FILE_URI };
if(source == 1){ cameraOptions = { quality: 70, destinationType: Camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,targetWidth: 600,targetHeight: 600 }; }
navigator.camera.getPicture(function (imageURI) {
window.resolveLocalFileSystemURI(imageURI, function (fileEntry) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSys) {
fileSys.root.getDirectory("auditPhotos", {create: true, exclusive: false}, function(dir) {
fileEntry.copyTo(dir,generateRandomID()+".jpg",function (entry) {
deferred.resolve(entry.fullPath)
}, null);
}, null);
}, null);
},null);
},
function (message) {
deferred.reject(message);
},
cameraOptions
);
//deferred.resolve(generateRandomID()+".jpg");
return deferred.promise;
}