Monday, 19 August 2013

how to read selected image bytes data from UIImagePickerController without using uiimage

how to read selected image bytes data from UIImagePickerController without
using uiimage

How to read UIImagePickerController selected image bytes to NSData ? If I
use the below code with
UIImageJPEGRepresentation/UIImagePNGRepresentation, I am not getting the
total image bytes.
For example my source image is having 1000bytes of data, in that last 10
bytes are my encryption data which is not related to image. By using the
below code i am not able to read all the 1000bytes. I am only getting 990
bytes.
-(void)imagePickerController:(UIImagePickerController*)picker
didFinishPickingMediaWithInfo:(NSDictionary*)info
{
NSData dataImage = UIImageJPEGRepresentation([info
objectForKey:@"UIImagePickerControllerOriginalImage"],1);
}
I also tried the option of Convert UIImage to NSData without using
UIImagePngrepresentation or UIImageJpegRepresentation. But failed to
achieve this scenario.
Can somebody guide me how to proceed on this?

No comments:

Post a Comment