Skip to content

Instantly share code, notes, and snippets.

@stuffmc
Created June 9, 2011 12:18
Show Gist options
  • Save stuffmc/1016621 to your computer and use it in GitHub Desktop.
Save stuffmc/1016621 to your computer and use it in GitHub Desktop.
imageWithCGImage:scale:orientation:
- (void)upload:(UIImage*)image {
CGFloat width = [image size].width;
CGFloat scale = 600/width;
UIImage *picture = [UIImage imageWithCGImage:[image CGImage] scale:scale orientation:UIImageOrientationRight];
NSLog(@"image: %@ - picture: %@", NSStringFromCGSize([image size]), NSStringFromCGSize([picture size]));
image: {1536, 2048} - picture: {3932.16, 5242.88}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment