views:

39

answers:

2

I wonder how to save the UIImage object from UIImagePickerController into the App Document directory. I tried to use UIImageJPEGRepresentation() method and UIImagePNGRepresentation(), but it seemed the image data was changed. Is there any method to keep the original image content without any compression?

+1  A: 

I wrote a short example on iPhoneDeveloperTips.com that may help:

Save UIImage Object as a PNG or JPEG File

John
Thank you for the suggestion. But I need to store the original image.
Leon
A: 

PNG employs lossless data compression and is a good option for you. You can read more at the wiki link. A UIImage that is created from PNG data should be identical to the UIImage it was created from. I'm not sure where your image is coming from but a PNG will be a different size than a JPEG it was created from, but the bitmap data should be the same.

rebelzach