Skip to content

Commit

Permalink
Faster cropping
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdon committed Feb 24, 2017
1 parent e22e0b8 commit ba54647
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions FastttCamera/UIImage+FastttCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ - (UIImage *)fastttImageWithNormalizedOrientation
FastttRound(self.size.width),
FastttRound(self.size.height));

CGImageRef imageRef = CGImageRetain(CGImageCreateWithImageInRect([self CGImage], newRect));
UIGraphicsBeginImageContextWithOptions(newRect.size, YES, self.scale);
[self drawInRect:newRect];

UIImage *normalized = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImage *normalized = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);

return normalized;
}
Expand Down

0 comments on commit ba54647

Please sign in to comment.