我正在開發一個應用程序在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;
}