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 3322f24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions FastttCamera/UIImage+FastttCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,10 @@ - (UIImage *)fastttImageWithNormalizedOrientation
FastttRound(self.size.width),
FastttRound(self.size.height));

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

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

return normalized;
}
Expand Down

0 comments on commit 3322f24

Please sign in to comment.