Skip to content

Commit dccf433

Browse files
author
Sam Davies
committed
Corrects the orientation of the generated QR code
1 parent ae4b78f commit dccf433

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

15-core-image-filters/ImageFilter/ImageFilter/SCQRGeneratorViewController.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ - (UIImage *)createNonInterpolatedUIImageFromCIImage:(CIImage *)image withScale:
8484
// Tidy up
8585
UIGraphicsEndImageContext();
8686
CGImageRelease(cgImage);
87-
return scaledImage;
87+
// Need to set the image orientation correctly
88+
UIImage *flippedImage = [UIImage imageWithCGImage:[scaledImage CGImage]
89+
scale:scaledImage.scale
90+
orientation:UIImageOrientationDownMirrored];
91+
92+
return flippedImage;
8893
}
8994
@end

0 commit comments

Comments
 (0)