diff --git a/Classes/BITHockeyHelper.m b/Classes/BITHockeyHelper.m index 41c1911e50..d7776170cf 100644 --- a/Classes/BITHockeyHelper.m +++ b/Classes/BITHockeyHelper.m @@ -742,7 +742,10 @@ UIImage *bit_screenshot(void) { BOOL isLandscapeRight = [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight; BOOL isUpsideDown = [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown; - if (isLandscapeLeft ||isLandscapeRight) { + BOOL needsRotation = NO; + + if ((isLandscapeLeft ||isLandscapeRight) && imageSize.height > imageSize.width) { + needsRotation = YES; CGFloat temp = imageSize.width; imageSize.width = imageSize.height; imageSize.height = temp; @@ -771,10 +774,12 @@ UIImage *bit_screenshot(void) { -[window bounds].size.width * [[window layer] anchorPoint].x, -[window bounds].size.height * [[window layer] anchorPoint].y); - if (isLandscapeLeft) { - CGContextConcatCTM(context, CGAffineTransformRotate(CGAffineTransformMakeTranslation( imageSize.width, 0), M_PI / 2.0)); - } else if (isLandscapeRight) { - CGContextConcatCTM(context, CGAffineTransformRotate(CGAffineTransformMakeTranslation( 0, imageSize.height), 3 * M_PI / 2.0)); + if (needsRotation) { + if (isLandscapeLeft) { + CGContextConcatCTM(context, CGAffineTransformRotate(CGAffineTransformMakeTranslation( imageSize.width, 0), M_PI / 2.0)); + } else if (isLandscapeRight) { + CGContextConcatCTM(context, CGAffineTransformRotate(CGAffineTransformMakeTranslation( 0, imageSize.height), 3 * M_PI / 2.0)); + } } else if (isUpsideDown) { CGContextConcatCTM(context, CGAffineTransformRotate(CGAffineTransformMakeTranslation( imageSize.width, imageSize.height), M_PI)); } diff --git a/Classes/BITImageAnnotationViewController.m b/Classes/BITImageAnnotationViewController.m index 3fc15cb6ce..376ddd245a 100644 --- a/Classes/BITImageAnnotationViewController.m +++ b/Classes/BITImageAnnotationViewController.m @@ -153,7 +153,7 @@ typedef NS_ENUM(NSInteger, BITImageAnnotationViewControllerInteractionMode) { - (void)fitImageViewFrame { CGSize size = [UIScreen mainScreen].bounds.size; - if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)){ + if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation) && size.height > size.width){ size = CGSizeMake(size.height, size.width); }