사진을 페이스 북에 업로드합니다. 사진 너비> 높이 인 경우 모든 사항이 정상입니다. 높이> 너비라면 페이스 북에 사진이 표시되므로 페이스 북 계정 사진의 너비가 높이로 표시되지만 (물론) 방향은 틀립니다. 내 코드 :사진을 Facebook 문제로 업로드하십시오. 틀린 사진 오리엔테이션
나는 완전히로 이미지 크기를 확인 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;
}
}
는 슈어 내 이미지 폭 < 높이가. 너비는 약 2200, 높이는 3300이며 페이스 북 앨범 이미지는 너비> 높이로 나타납니다.
미리 감사드립니다.
사진의 Exif 태그가 원인인지 확인 했습니까? –