Przesyłanie obrazu na serwer, odbieranie obróconego obrazu
W mojej aplikacji chcę przesłać obraz na serwer i pobrać adres URL przesłanego obrazu, aby wyświetlić go w aplikacji. Wysyłam NSData obrazu. Oto mój kod:
AsynchronousImageView *imgVw_User = (AsynchronousImageView*)[self.view viewWithTag:K_TagImageViewUser];
UIImage *UserImgForBioData = imgVw_User.image;
UserImgForBioData = [UIImage imageWithCGImage:UserImgForBioData.CGImage scale:1.0f orientation:UserImgForBioData.imageOrientation];
NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(UserImgForBioData,0.5)];
Base64Transcoder *temp_transcoder=[[Base64Transcoder alloc]init];
NSString * temp_base64EncodedImage= @"";
if (imageData!=nil)
{
temp_base64EncodedImage = [NSString stringWithFormat:@"%@",[temp_transcoder base64EncodedStringfromData:imageData]];
temp_base64EncodedImage = [[temp_base64EncodedImage stringByReplacingOccurrencesOfString:@"\n"
withString:@""]
mutableCopy];
}
Kiedyś po wyświetleniu obrazu, pobierając adres URL obrazu, obraz jest obracany. czy robię coś źle?