gekitz/GKImagePicker — pull request #22 by ziweizhou (2013-05-17 16:10:49+00:00)
Title: some adjustment for scale calculation in croppedImage

Thanks for creating this open source plugin. I really like it.

I added some code to handle cropping image when the orientation and crop rectangle in opposite situation. (Portrait Image with Landscape Crop rectangle or vice versa)

if (self.cropSize.width>self.cropSize.height) {
scale = self.imageToCrop.size.width < self.imageToCrop.size.height ? MAX(scaleWidth, scaleHeight) : MIN(scaleWidth, scaleHeight);
}else{
scale = self.imageToCrop.size.width < self.imageToCrop.size.height ? MIN(scaleWidth, scaleHeight) : MAX(scaleWidth, scaleHeight);
}