From c8f74d2de05419180402dbcd6569c2ff1e28150c Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Tue, 8 Oct 2024 17:39:50 +0800 Subject: [PATCH] Fix the test case on iOS 18.0 simulator --- Tests/Tests/SDImageCoderTests.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tests/Tests/SDImageCoderTests.m b/Tests/Tests/SDImageCoderTests.m index 126c0e4e..a689c01d 100644 --- a/Tests/Tests/SDImageCoderTests.m +++ b/Tests/Tests/SDImageCoderTests.m @@ -563,7 +563,12 @@ UIImage *systemImage = [[UIImage alloc] initWithData:data]; #if SD_UIKIT orientation = systemImage.imageOrientation; - expect(orientation).equal(UIImageOrientationDown); + if (@available(iOS 18.0, tvOS 18.0, watchOS 11.0, *)) { + // Apple fix/hack this kind of JFIF on iOS 18 + expect(orientation).equal(UIImageOrientationUp); + } else { + expect(orientation).equal(UIImageOrientationDown); + } #endif // Check bitmap color equal, between our usage of ImageIO decoder and Apple system API behavior