I am uploading photos to a server with an IOS app. It is important that the photos are uploaded with no loss in quality and are uploaded as jpeg's. My current problem is that the photos upload with no loss of quality but have a larger than expected file size. For example: I uploaded a file through the app and the file size was 4.7 MB. When I Emailed the same photo to myself and selected the "Actual Photo" option for the email, The size of the photo was only 1.7 MB. A side by side comparison revealed no difference in quality.
Here is how I am uploading the files.
ALAssetsLibrary *library = [ALAssetsLibrary new];
[library getImageAtURL:orderImage.imageUrl with completionBlock:^(UIImage *image)
NSData *fileData = UIImageJPEGRepresentation(image, 1.0)
NSURLRequest *request = [self multipartFormRequestWithMethod:@"POST" path:path parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData)
{
[formData appendPartWithFileData:fileData name:@"uploadedfile" fileName:fileName mimeType:mimeType];
[formData appendPartWithFormData:[extraInfo dataUsingEncoding:NSISOLatin2StringEncoding] name:@"extraInfo"];
}];