Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS UIImagePickerController result image orientation after upload
    primarykey
    data
    text
    <p>I am testing my iPhone application on an iOS 3.1.3 iPhone. I am selecting/capturing an image using a <code>UIImagePickerController</code>:</p> <pre><code>UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; [imagePicker setDelegate:self]; [self.navigationController presentModalViewController:imagePicker animated:YES]; [imagePicker release]; - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { self.image = [info objectForKey:UIImagePickerControllerOriginalImage]; imageView.image = self.image; [self.navigationController dismissModalViewControllerAnimated:YES]; submitButton.enabled = YES; } </code></pre> <p>I then at some point send it to my web server using the ASI classes:</p> <pre><code>ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://example.com/myscript.php"]]; [request setDelegate:self]; [request setStringEncoding:NSUTF8StringEncoding]; [request setShouldContinueWhenAppEntersBackground:YES]; //other post keys/values [request setFile:UIImageJPEGRepresentation(self.image, 100.0f) withFileName:[NSString stringWithFormat:@"%d.jpg", [[NSDate date] timeIntervalSinceNow]] andContentType:@"image/jpg" forKey:@"imageFile"]; [request startAsynchronous]; </code></pre> <p>the problem: when i take a picture with the iphone while holding it landscape, the image gets uploaded to the server and it viewed like you would expect. when taking a picture holding the phone in portrait, the image is uploaded and viewed as it had been rotated 90 degrees.</p> <p>my application is set to only work in portrait modes(upsidedown and regular).</p> <p>How can i make the image always show the correct orientation after uploading?</p> <p>the image appears to be correct as displayed in an UIImageView(directly after taking the picture), but viewing on the server says otherwise.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload