I have the following 2 issues with iPhone 4 images. Any help is appreciated.
When using iPhone 4 if I access an image from photo library in my app and save it in a database, then retrieve it again, I see it has lost resolution. The same works fine on 3G - no loss of resolution. Any idea why this could be happening?
I am using retina scan images on iPhone 4 for buttons. They are set directly from the IB. Sometimes I see they are skewed to half the height and same width. Again, this is not seen on 3G and everything works fine.
Any help is much appreciated.
Here's the code which I use to access from library. I dont think saving to database is causing it. I am using an "ImageToDataTransformer".
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *img;
img = [self scaleAndRotateImage:[info objectForKey:UIImagePickerControllerOriginalImage]];
imageView.image = [img imageByScalingProportionallyToSize:targetSize];
}
In scaleAndRotateImage I use "static int kMaxResolution = 640;" Will this work for iPhone 4? May be this could be the issue.
Code for scaleAndRotateImage is found here