Update one failed test case during the 5.18 version changes

This commit is contained in:
DreamPiggy 2023-11-16 18:46:15 +08:00
parent 106a8d1a15
commit 404d992c8f
1 changed files with 3 additions and 1 deletions

View File

@ -317,9 +317,11 @@
- (void)test13ThatScaleDownLargeImageEXIFOrientationImage { - (void)test13ThatScaleDownLargeImageEXIFOrientationImage {
XCTestExpectation *expectation = [self expectationWithDescription:@"SDWebImageScaleDownLargeImages works on EXIF orientation image"]; 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"]; 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(); expect(image).notTo.beNil();
#if SD_UIKIT #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]; UIImageOrientation orientation = [SDImageCoderHelper imageOrientationFromEXIFOrientation:kCGImagePropertyOrientationUpMirrored];
expect(image.imageOrientation).equal(orientation); expect(image.imageOrientation).equal(orientation);
#endif #endif