I need edit my Images before they import to the app but after editing the image reduces some quality how can avoid this ?
- (void) imagePickerController:(UI
You can crop UIImagePickerControllerOriginalImage
manually by using the value provided via UIImagePickerControllerCropRect
.
Untested quick and dirty example:
static UIImage *my_croppedImage(UIImage *image, CGRect cropRect)
{
UIGraphicsBeginImageContext(cropRect.size);
[image drawAtPoint:CGPointMake(-cropRect.origin.x, -cropRect.origin.y)];
UIImage *cropped = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return cropped;
}
- (void) imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// …
UIImage *originalImage = info[UIImagePickerControllerOriginalImage];
CGRect cropRect = [info[UIImagePickerControllerCropRect] CGRectValue];
UIImage *croppedImage = my_croppedImage(originalImage, cropRect);
// …
}