我正在尝试将相机图像从iPhone上传到我的网络服务器,但是当我从服务器下载时,图像会改变它的方向.这只发生在相机图像而不是从我的机器上传到设备的简单图像.Plz帮助我.
我已使用此条件在服务器端旋转图像:
// obj将在服务器上传图像时传递Orientation,其值将为1或3或6或8
switch ((ushort)obj)
{
case 1: //up
return 0;
case 3: //down
return 180;
case 6: //left
return 90;
case 8: //right
return 270;
default:
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但我仍然遇到同样的问题
这是我上传图片的代码:
-(void)uploadSingleFile
{
if(!self.objWebServices.bSyncWasOn)
{
NSLog(@"STOP upload Single File RETURN");
[self Call_SaveSyncedImageID];
return;
}
SyncItem* item = [arrSelSyncItemIDS objectAtIndex:nSyncItemIndex];
if(item.nType == SYNC_STATUS_NOT_SELECTED || item.nType == SYNC_STATUS_SYNC_DONE)
{
nSyncItemIndex = nSyncItemIndex + 1;
if([arrSelSyncItemIDS count] > nSyncItemIndex)
{
NSLog(@"Called uploadSingleFile");
[self uploadSingleFile];
return;
}
else
{
//[self LoadImages:!bShowHideSyncImages];
[SVProgressHUD …Run Code Online (Sandbox Code Playgroud)