coryalder/UIImage_Resize — Issue #2: croppedImage: returns image in wrong orientation
Author: averydev
Created: 2011-11-06 20:34:52+00:00
State: open

The `- (UIImage *)croppedImage:(CGRect)bounds;` method in UIImage+Resize method doesn't take into account the orientation of the image.

Within that method, if you were to replace this line:

UIImage *croppedImage = [UIImage imageWithCGImage:imageRef];

with this:

UIImage *croppedImage = [UIImage imageWithCGImage:imageRef scale:1.0 orientation:self.imageOrientation];

that problem goes away, and doesn't seem to impact the rest of the functionality.