0

I am Copying the array of Images in UIPasteBoard and When I try to Paste the images in mail the Image orientation is changing. This is How I am Copying the Images.

UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
pasteBoard.images = imageArray; 

How can I copy the images without changing the Image orientation ?

Aravindhan
  • 15,608
  • 10
  • 56
  • 71

2 Answers2

0

UIImage's imageWithCGImage:scale:orientation: method can modify the orientation if you're not pleased with the results.

What your mail app is displaying is probably the true pixel array before the orientation info is applied to rotate it.

http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html#//apple_ref/occ/clm/UIImage/imageWithCGImage:scale:orientation:

Jason Fuerstenberg
  • 1,341
  • 13
  • 13
0

I have this working. I just use the setData to give it raw data and then set the data type using forPasteboardType. Right below your

if (fileExists){

Try this

  NSData *data = [NSData dataWithContentsOfFile:imagefile];
    [pasteboard setData:data forPasteboardType:@"public.png"];

May this Helping to you.

Nimit Parekh
  • 16,776
  • 8
  • 50
  • 72