0

I am trying to transfer the photo image data accessed from the Photos framework to my external accessory. I am able to transfer the data. However, I am not able to open the file correctly.

I access the data of the image using the NSData in the PHImagemanager. I am transferring the image to an external device (SD card using the External accessory protocol). The transfer takes place successfully. I can see the ASCII contents of the original file and the transferred file and they both look the same. But I cannot open the file.

I was thinking that do I have to do some processing on the data I receive through NSData to open the image successfully?

Vvk
  • 4,031
  • 29
  • 51
bob
  • 33
  • 5
  • show code, please. – john elemans May 02 '16 at 22:59
  • The code is in 5 different functions. It is not a small piece of code with few lines... – bob May 03 '16 at 19:26
  • show the code where the file open fails. – john elemans May 03 '16 at 19:27
  • The file does not open on the computer. It is not on iphone. – bob May 04 '16 at 00:18
  • I doubt the way I am acquiring the data from iPhone. When you use the image manager, do you access the data using imageData or by using the URL in the info dictionary. – bob May 04 '16 at 00:20
  • [[PHImageManager defaultManager] requestImageDataForAsset: asset options:imageRequestOptions resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) – bob May 04 '16 at 00:21
  • This is how I am trying to access the image. I am then using the imageData to get the data bytes of the image – bob May 04 '16 at 00:21

0 Answers0