Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 上传照片到facebook问题。错误的照片方向_Iphone_Facebook_Image_Facebook Graph Api - Fatal编程技术网

Iphone 上传照片到facebook问题。错误的照片方向

Iphone 上传照片到facebook问题。错误的照片方向,iphone,facebook,image,facebook-graph-api,Iphone,Facebook,Image,Facebook Graph Api,我把照片上传到facebook上。 如果照片宽度>高度,则一切正常。 但是如果高度>宽度,facebook会打开照片,所以在facebook帐户中,照片显示为宽度>高度,但是(当然)方向是错误的。 我的代码: 在postImageToFaceBook中,我检查图像大小是否完全符合舒尔标准,即图像宽度高度 提前谢谢你 事实上,facebook没有在图像上做任何事情。iPhone在横向模式下以纵向模式显示所有图像。所以,请检查您的系统上的图像 谢谢,我解决了这个问题。 这种行为发生在图像宽度约为20

我把照片上传到facebook上。 如果照片宽度>高度,则一切正常。 但是如果高度>宽度,facebook会打开照片,所以在facebook帐户中,照片显示为宽度>高度,但是(当然)方向是错误的。 我的代码:

在postImageToFaceBook中,我检查图像大小是否完全符合舒尔标准,即图像宽度<高度。宽度约为2200,高度约为3300,facebook相册图像显示为宽度>高度


提前谢谢你

事实上,facebook没有在图像上做任何事情。iPhone在横向模式下以纵向模式显示所有图像。所以,请检查您的系统上的图像

谢谢,我解决了这个问题。
这种行为发生在图像宽度约为2000像素时,但如果宽度小于1000像素,则一切正常。

您是否看到照片的Exif标记导致了这种情况?否,在postImageToFaceBook中,我检查了图像大小,宽度约为2200,高度为3300,facebook相册图像显示为宽度>高度。我更新了postHave you checked image in your System。几天前,我也面临同样的问题。在上传到fb之前,请确保你们并没有调整图像大小。在我检查宽度约为2200,高度为3300后,我不会调整图像大小。“您是否已检查系统中的图像”是什么意思。正如我之前所说,在发送之前,我检查了图像的大小。实际上,图像在设备中看起来总是很好的。所以,请把这张图片复制到你们的电脑里,然后检查它是纵向的还是横向的?好的,我把图片添加到了图书馆(在postImageToFaceBook中)。然后复制到电脑上。这是肖像。
- (void)postImageToFaceBook:(UIImage *)imgSource
{
    [self login];

    currentAPICall = kAPIGraphUserPhotosPost;

    NSString *strMessage = @"This is the photo caption";
    NSMutableDictionary* photosParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                         imgSource,@"source",
                                         strMessage,@"message",
                                         nil];

    NSLog(@"Begin sending photo\n\n");
    [_facebook requestWithGraphPath:@"me/photos"
                          andParams:photosParams
                      andHttpMethod:@"POST"
                        andDelegate:self];
}

- (void)login
{
    if (![_facebook isSessionValid]) {
        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"user_photos",
                                nil];
        [_facebook authorize:permissions];
        [permissions release];
    }
}

- (void)logout
{
    [_facebook logout];
}


#pragma mark - FBRequestDelegate

- (void)request:(FBRequest *)request didLoad:(id)result {
    NSLog(@"Request load\n\n");
    [self hideHud];

    if ([result isKindOfClass:[NSArray class]] && ([result count] > 0)) {
        result = [result objectAtIndex:0];
    }

    switch (currentAPICall) {
        case kAPIGraphPhotoData: // step 3
        {
            NSLog(@"sending to wall\n\n");
            // Facebook doesn't allow linking to images on fbcdn.net.  So for now use default thumb stored on Picasa

            NSString *thumbURL = kDefaultThumbURL;
            NSString *imageLink = [NSString stringWithFormat:[result objectForKey:@"link"]];    

            currentAPICall = kDialogFeedUser;


            NSMutableDictionary* dialogParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                 kAppId, @"app_id",
                                                 imageLink, @"link",
                                                 thumbURL, @"picture",
                                                 @"Photo from my iPhone application", @"name",
                                                 @"The app", @"caption",
                                                 @"it is fun to use", @"description",
                                                 nil];

            [_facebook dialog:@"feed" 
                    andParams:dialogParams 
                  andDelegate:self];


            break;
        }
        case kAPIGraphUserPhotosPost: // step 2
        {
            NSLog(@"getting data\n\n");
            [self showHudWithMessage:@"Getting image data"];
            NSString *imageID = [NSString stringWithFormat:[result objectForKey:@"id"]];            
            NSLog(@"id of uploaded screen image %@",imageID);

            currentAPICall = kAPIGraphPhotoData;

            [_facebook requestWithGraphPath:imageID
                                andDelegate:self];

            break;
        }
        default:
            break;
    }
}


#pragma mark - FBDialogDelegate

- (void)dialogDidComplete:(FBDialog *)dialog {
    switch (currentAPICall) {
        case kDialogFeedUser:
        {
            NSLog(@"Feed published successfully.");
        }
            break;
        default:
            break;
    }
}