From 404d992c8f80fb03d18148708f310fb1eaabb57c Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 16 Nov 2023 18:46:15 +0800 Subject: [PATCH] Update one failed test case during the 5.18 version changes --- Tests/Tests/SDWebImageManagerTests.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/Tests/SDWebImageManagerTests.m b/Tests/Tests/SDWebImageManagerTests.m index d5007ca9..a35231f1 100644 --- a/Tests/Tests/SDWebImageManagerTests.m +++ b/Tests/Tests/SDWebImageManagerTests.m @@ -317,9 +317,11 @@ - (void)test13ThatScaleDownLargeImageEXIFOrientationImage { XCTestExpectation *expectation = [self expectationWithDescription:@"SDWebImageScaleDownLargeImages works on EXIF orientation image"]; NSURL *originalImageURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_2.jpg"]; - [SDWebImageManager.sharedManager loadImageWithURL:originalImageURL options:SDWebImageScaleDownLargeImages progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { + [SDWebImageManager.sharedManager loadImageWithURL:originalImageURL options:SDWebImageScaleDownLargeImages context:@{SDWebImageContextImageForceDecodePolicy : @(SDImageForceDecodePolicyNever)} progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { expect(image).notTo.beNil(); #if SD_UIKIT + // The UIGraphicsImageRenderer will correct image to Up(1) orientation + // So we disable that to test the behavior UIImageOrientation orientation = [SDImageCoderHelper imageOrientationFromEXIFOrientation:kCGImagePropertyOrientationUpMirrored]; expect(image.imageOrientation).equal(orientation); #endif