Not sure what this would cause, but when I upload some images to my remote server via FileTransfer()
, the images sometimes appear either sideways or upside down. However, when I view images locally on the iPhone, they are located correctly.
For example, when I select such an image for download: http://sharefa.st/view/WBe2QNSK8r8z
It will look like this: http://sharefa.st/view/EWdW1Z4G8r8z
I use the local path to transfer the file, so I don’t understand why the image will rotate “randomly”.
Here is my download function:
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
The value is as follows:
file://localhost/var/mobile/Applications/<snip>/tmp/photo_015.jpg
Any understanding is understood.
source share