From 4563514b90d8174aca6fde5956e7821c0e75e09f Mon Sep 17 00:00:00 2001 From: jeongkyu kim Date: Thu, 28 Dec 2017 11:32:48 +0900 Subject: [PATCH] Fix image Orientation --- YYImage/YYFrameImage.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YYImage/YYFrameImage.m b/YYImage/YYFrameImage.m index 93efe88..416d97f 100644 --- a/YYImage/YYFrameImage.m +++ b/YYImage/YYFrameImage.m @@ -68,7 +68,7 @@ - (instancetype)initWithImagePaths:(NSArray *)paths frameDurations:(NSArray *)fr NSData *firstData = [NSData dataWithContentsOfFile:firstPath]; CGFloat scale = _NSStringPathScale(firstPath); UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; - self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; + self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:firstCG.imageOrientation]; if (!self) return nil; long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); _oneFrameBytes = (NSUInteger)frameByte; @@ -94,7 +94,7 @@ - (instancetype)initWithImageDataArray:(NSArray *)dataArray frameDurations:(NSAr NSData *firstData = dataArray[0]; CGFloat scale = [UIScreen mainScreen].scale; UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; - self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; + self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:firstCG.imageOrientation]; if (!self) return nil; long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); _oneFrameBytes = (NSUInteger)frameByte;