不知道會是什麼造成這一點,但是當我通過FileTransfer()
某些圖片上傳到我的遠程服務器,圖像有時會出現要麼橫盤或倒置。但是,當我在iPhone上本地查看圖像時,它們以正確的方式定位。圖像通過PhoneGap的(IOS)上載後側身/顛倒了
例如,當我選擇這樣要上傳的圖片:
它會變成這樣:http://sharefa.st/view/EWdW1Z4G8r8z
我現在用的是本地路徑來傳輸文件,所以不理解爲什麼圖像會「隨機」旋轉。
這裏是我的上傳功能:
function uploadPhoto() {
var options = new FileUploadOptions();
options.fileKey = 'file';
options.fileName = imgURI.substr(imgURI.lastIndexOf('/')+1);
options.mimeType = 'image/jpeg';
var params = new Object();
if(logged_in == true) {
params.unique_id = app_unique_id;
params.secret_key = user_secret_key;
}
options.params = params;
loadingStart();
var ft = new FileTransfer();
ft.upload(imgURI, 'http://' + remote_server + '/API/upload', uploadDetails, fail, options);
}
imgURI
值如下:
file://localhost/var/mobile/Applications/<snip>/tmp/photo_015.jpg
任何有識之士的讚賞。
我也有iOS上同樣的問題,我會盡快鑽研它。 – 2012-02-19 22:18:29