In my app, the user can take an image through the camera or chose one from the photo album. (I save the photo taken with the camera in the photo album).
In both cases, I would like to save a scaled copy (640x920) of the image in the documents directory.
How can I proceed to scale and then save the resulting image?
The easiest way is with NYXImagesUtilities.
Here's the github page.
A basic example of using it.
// #import <QuartzCore/QuartzCore.h>
// #import "NYXImagesUtilities.h"
//.. path is an NSString of the documents directory + file name you want to save it to.
//.. myImage is the UIImage that you got from the user.
UIImage *scaledImage = [myImage scaleToFitSize:(CGSize){640, 920}];
[scaledImage saveToPath:path type:NYXImageTypePNG];