Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Keep original image orientation when it is cropped #169

Merged
merged 1 commit into from

2 participants

@gsempe

No description provided.

@soffes soffes merged commit 6bd46fc into soffes:master
@soffes
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2013
  1. @gsempe

    Keep original image orientation when it is cropped

    gsempe authored gsempe committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  SSToolkit/UIImage+SSToolkitAdditions.m
View
2  SSToolkit/UIImage+SSToolkitAdditions.m
@@ -28,7 +28,7 @@ - (UIImage *)imageCroppedToRect:(CGRect)rect {
rect = CGRectMake(rect.origin.x * scale, rect.origin.y * scale, rect.size.width * scale, rect.size.height * scale);
CGImageRef imageRef = CGImageCreateWithImageInRect(self.CGImage, rect);
- UIImage *cropped = [UIImage imageWithCGImage:imageRef];
+ UIImage *cropped = [UIImage imageWithCGImage:imageRef scale:scale orientation:self.imageOrientation];
CGImageRelease(imageRef);
return cropped;
}
Something went wrong with that request. Please try again.