- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// Access the uncropped image from info dictionary
UIImage* image = (UIImage* ) [info objectForKey:@"UIImagePickerControllerOriginalImage"];
imageFromCamera = [image copy];
// Save image
UIImageWriteToSavedPhotosAlbum(imageFromCamera, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
[picker release];
CGSize size = CGSizeMake(340, 480);
UIGraphicsBeginImageContext(size);// a CGSize that has the size you want
[imageFromCamera drawInRect:CGRectMake(0,0,size.width,size.height)];
//image is the original UIImage
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
imageData = UIImageJPEGRepresentation(newImage, 0.5);
imageDataTotal = [imageData copy];
}