I have app in which i capture the image it works fine but i want to reduce the size of the image i searched from net i found some code which is here
This is my code working fine when image captured
NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
UIImage *pickedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
NSData *imageData = UIImagePNGRepresentation(pickedImage);
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
I want to reduce the size of picked image i got the following code but i am did not getting it use like it use newSize but where it is using the original image to compress
UIGraphicsBeginImageContext(newSize);
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();