mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
24 lines
607 B
Mathematica
24 lines
607 B
Mathematica
|
//
|
||
|
// UIImage+normalizeImage.m
|
||
|
// Signal
|
||
|
//
|
||
|
// Created by Frederic Jacobs on 26/12/14.
|
||
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "UIImage+normalizeImage.h"
|
||
|
|
||
|
@implementation UIImage (normalizeImage)
|
||
|
|
||
|
- (UIImage *)normalizedImage {
|
||
|
if (self.imageOrientation == UIImageOrientationUp) return self;
|
||
|
|
||
|
UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
|
||
|
[self drawInRect:(CGRect){0, 0, self.size}];
|
||
|
UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext();
|
||
|
UIGraphicsEndImageContext();
|
||
|
return normalizedImage;
|
||
|
}
|
||
|
|
||
|
@end
|