From ce406a2b2dcedd4e2b9a823c54f34aa2ba3fe08d Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Tue, 23 Jul 2024 14:40:20 +0800 Subject: [PATCH] Disable the heics animated encoding on macOS Virtualization only (still broken) Rename this file extension to heics to match the standard --- .../project.pbxproj | 20 +++++++++--------- ...eAnimated.heic => TestImageAnimated.heics} | Bin Tests/Tests/SDImageCoderTests.m | 17 +++++++++++---- 3 files changed, 23 insertions(+), 14 deletions(-) rename Tests/Tests/Images/{TestImageAnimated.heic => TestImageAnimated.heics} (100%) diff --git a/Tests/SDWebImage Tests.xcodeproj/project.pbxproj b/Tests/SDWebImage Tests.xcodeproj/project.pbxproj index adee4150..68627ec7 100644 --- a/Tests/SDWebImage Tests.xcodeproj/project.pbxproj +++ b/Tests/SDWebImage Tests.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ 32464A902B7B1833006BE70E /* 1@2x.gif in Resources */ = {isa = PBXBuildFile; fileRef = 32648066250232F7004FA0FC /* 1@2x.gif */; }; 32464A912B7B1833006BE70E /* TestImage.nef in Resources */ = {isa = PBXBuildFile; fileRef = 32F788A2290D252200B57A1C /* TestImage.nef */; }; 32464A922B7B1833006BE70E /* TestImage.heic in Resources */ = {isa = PBXBuildFile; fileRef = 327A418B211D660600495442 /* TestImage.heic */; }; - 32464A932B7B1833006BE70E /* TestImageAnimated.heic in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heic */; }; + 32464A932B7B1833006BE70E /* TestImageAnimated.heics in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heics */; }; 32464A942B7B1833006BE70E /* TestJFIF.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3264CD162AAB1E23001E338B /* TestJFIF.jpg */; }; 32464A952B7B1833006BE70E /* TestImageStatic.webp in Resources */ = {isa = PBXBuildFile; fileRef = 32515F9724AF1919005E8F79 /* TestImageStatic.webp */; }; 32464A962B7B1833006BE70E /* TestImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 433BBBB61D7EF8200086B6E9 /* TestImage.gif */; }; @@ -94,8 +94,8 @@ 328BB6DE20825E9800760D6C /* SDWebImageTestCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 328BB6DC20825E9800760D6C /* SDWebImageTestCache.m */; }; 32905E64211D786E00460FCF /* TestImage.heif in Resources */ = {isa = PBXBuildFile; fileRef = 32905E63211D786E00460FCF /* TestImage.heif */; }; 32905E65211D786E00460FCF /* TestImage.heif in Resources */ = {isa = PBXBuildFile; fileRef = 32905E63211D786E00460FCF /* TestImage.heif */; }; - 3297A09F23374D1700814590 /* TestImageAnimated.heic in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heic */; }; - 3297A0A023374D1700814590 /* TestImageAnimated.heic in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heic */; }; + 3297A09F23374D1700814590 /* TestImageAnimated.heics in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heics */; }; + 3297A0A023374D1700814590 /* TestImageAnimated.heics in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heics */; }; 329922732365DC6100EAFD97 /* SDImageCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D68195475D800390AB0 /* SDImageCacheTests.m */; }; 329922742365DC6100EAFD97 /* SDWebImageManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */; }; 329922752365DC6100EAFD97 /* SDWebImageDownloaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E3C51E819B46E370092B5E6 /* SDWebImageDownloaderTests.m */; }; @@ -123,7 +123,7 @@ 3299228B2365DC6C00EAFD97 /* TestImage.heic in Resources */ = {isa = PBXBuildFile; fileRef = 327A418B211D660600495442 /* TestImage.heic */; }; 3299228C2365DC6C00EAFD97 /* TestImage.heif in Resources */ = {isa = PBXBuildFile; fileRef = 32905E63211D786E00460FCF /* TestImage.heif */; }; 3299228D2365DC6C00EAFD97 /* TestImageAnimated.apng in Resources */ = {isa = PBXBuildFile; fileRef = 327054E1206CEFF3006EA328 /* TestImageAnimated.apng */; }; - 3299228E2365DC6C00EAFD97 /* TestImageAnimated.heic in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heic */; }; + 3299228E2365DC6C00EAFD97 /* TestImageAnimated.heics in Resources */ = {isa = PBXBuildFile; fileRef = 3297A09E23374D1600814590 /* TestImageAnimated.heics */; }; 32A571562037DB2D002EDAAE /* SDAnimatedImageTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A571552037DB2D002EDAAE /* SDAnimatedImageTest.m */; }; 32B4A4802C082A160004E42C /* TestImage.svg in Resources */ = {isa = PBXBuildFile; fileRef = 32B4A47F2C082A160004E42C /* TestImage.svg */; }; 32B4A4812C082A160004E42C /* TestImage.svg in Resources */ = {isa = PBXBuildFile; fileRef = 32B4A47F2C082A160004E42C /* TestImage.svg */; }; @@ -208,7 +208,7 @@ 328BB6DB20825E9800760D6C /* SDWebImageTestCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDWebImageTestCache.h; sourceTree = ""; }; 328BB6DC20825E9800760D6C /* SDWebImageTestCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageTestCache.m; sourceTree = ""; }; 32905E63211D786E00460FCF /* TestImage.heif */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestImage.heif; sourceTree = ""; }; - 3297A09E23374D1600814590 /* TestImageAnimated.heic */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestImageAnimated.heic; sourceTree = ""; }; + 3297A09E23374D1600814590 /* TestImageAnimated.heics */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestImageAnimated.heics; sourceTree = ""; }; 3299222A2365D9A100EAFD97 /* Tests TV.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests TV.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 3299222E2365D9A100EAFD97 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32A571552037DB2D002EDAAE /* SDAnimatedImageTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDAnimatedImageTest.m; sourceTree = ""; }; @@ -358,7 +358,7 @@ 32F788A2290D252200B57A1C /* TestImage.nef */, 32B4A47F2C082A160004E42C /* TestImage.svg */, 327054E1206CEFF3006EA328 /* TestImageAnimated.apng */, - 3297A09E23374D1600814590 /* TestImageAnimated.heic */, + 3297A09E23374D1600814590 /* TestImageAnimated.heics */, 32515F9824AF1919005E8F79 /* TestImageAnimated.webp */, 32515F9724AF1919005E8F79 /* TestImageStatic.webp */, 6B181A1A265757ED00BD06B3 /* TestAnimatedImageMemory.webp */, @@ -599,7 +599,7 @@ 32464A9D2B7B1833006BE70E /* TestImageAnimated.apng in Resources */, 32464A9F2B7B1833006BE70E /* IndexedPNG.png in Resources */, 32464AA02B7B1833006BE70E /* TestImage.jpg in Resources */, - 32464A932B7B1833006BE70E /* TestImageAnimated.heic in Resources */, + 32464A932B7B1833006BE70E /* TestImageAnimated.heics in Resources */, 32464A9A2B7B1833006BE70E /* TestImage.png in Resources */, 32464A9C2B7B1833006BE70E /* TestImage.pdf in Resources */, 32464A9E2B7B1833006BE70E /* TestImageAnimated.webp in Resources */, @@ -637,7 +637,7 @@ 329922882365DC6C00EAFD97 /* TestImage.jpg in Resources */, 32B4A4822C082A160004E42C /* TestImage.svg in Resources */, 32515F9E24AF1919005E8F79 /* TestImageAnimated.webp in Resources */, - 3299228E2365DC6C00EAFD97 /* TestImageAnimated.heic in Resources */, + 3299228E2365DC6C00EAFD97 /* TestImageAnimated.heics in Resources */, 32515F9B24AF1919005E8F79 /* TestImageStatic.webp in Resources */, 329922862365DC6C00EAFD97 /* TestImage.gif in Resources */, 329922852365DC6C00EAFD97 /* TestEXIF.png in Resources */, @@ -661,7 +661,7 @@ 321F310F27D0DC490042B274 /* TestImage.bmp in Resources */, 32B99EA6203B31360017FD66 /* TestImage.png in Resources */, 32648068250232F7004FA0FC /* 1@2x.gif in Resources */, - 3297A0A023374D1700814590 /* TestImageAnimated.heic in Resources */, + 3297A0A023374D1700814590 /* TestImageAnimated.heics in Resources */, 3278F5E32B04C1AC0004A6EE /* IndexedPNG.png in Resources */, 32B99EA2203B31360017FD66 /* MonochromeTestImage.jpg in Resources */, 32905E65211D786E00460FCF /* TestImage.heif in Resources */, @@ -693,7 +693,7 @@ 32648067250232F7004FA0FC /* 1@2x.gif in Resources */, 433BBBB91D7EF8260086B6E9 /* TestImage.png in Resources */, 3278F5E22B04C1AC0004A6EE /* IndexedPNG.png in Resources */, - 3297A09F23374D1700814590 /* TestImageAnimated.heic in Resources */, + 3297A09F23374D1700814590 /* TestImageAnimated.heics in Resources */, 327054E2206CEFF3006EA328 /* TestImageAnimated.apng in Resources */, 32B4A4802C082A160004E42C /* TestImage.svg in Resources */, 32515F9C24AF1919005E8F79 /* TestImageAnimated.webp in Resources */, diff --git a/Tests/Tests/Images/TestImageAnimated.heic b/Tests/Tests/Images/TestImageAnimated.heics similarity index 100% rename from Tests/Tests/Images/TestImageAnimated.heic rename to Tests/Tests/Images/TestImageAnimated.heics diff --git a/Tests/Tests/SDImageCoderTests.m b/Tests/Tests/SDImageCoderTests.m index 9729e978..5545f8b6 100644 --- a/Tests/Tests/SDImageCoderTests.m +++ b/Tests/Tests/SDImageCoderTests.m @@ -206,7 +206,11 @@ - (void)test13ThatHEICWorks { if (@available(iOS 11, tvOS 11, macOS 10.13, *)) { NSURL *heicURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImage" withExtension:@"heic"]; - BOOL supportsEncoding = YES; // GitHub Action Mac env supported from 20240707.1 +#if SD_MAC + BOOL supportsEncoding = !SDTestCase.isCI; // GitHub Action Mac env currently does not support HEIC encoding +#else + BOOL supportsEncoding = YES; // GitHub Action Mac env with simulator, supported from 20240707.1 +#endif [self verifyCoder:[SDImageIOCoder sharedCoder] withLocalImageURL:heicURL supportsEncoding:supportsEncoding @@ -236,8 +240,9 @@ - (void)test16ThatHEICAnimatedWorks { if (@available(iOS 13, tvOS 13, macOS 10.15, *)) { - NSURL *heicURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageAnimated" withExtension:@"heic"]; - BOOL supportsEncoding = YES; // GitHub Action Mac env supported from 20240707.1 + NSURL *heicURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageAnimated" withExtension:@"heics"]; + BOOL supportsEncoding = !SDTestCase.isCI; // GitHub Action Mac env currently does not support HEICS animated encoding (but HEIC supported, I don't know why) + // See: #3227 BOOL isAnimatedImage = YES; [self verifyCoder:[SDImageHEICCoder sharedCoder] withLocalImageURL:heicURL @@ -297,7 +302,11 @@ } - (void)test21ThatEmbedThumbnailHEICWorks { - BOOL supportsEncoding = YES; // GitHub Action Mac env supported from 20240707.1 +#if SD_MAC + BOOL supportsEncoding = !SDTestCase.isCI; // GitHub Action Mac env currently does not support HEIC encoding +#else + BOOL supportsEncoding = YES; // GitHub Action Mac env with simulator, supported from 20240707.1 +#endif if (!supportsEncoding) { return; }