Skip to content

Commit 2700838

Browse files
authored
Merge pull request #23 from SDWebImage/project_fix_avif_0.8
Fix the compatible with libavif 0.8+ version
2 parents d942206 + b883892 commit 2700838

File tree

9 files changed

+148
-120
lines changed

9 files changed

+148
-120
lines changed

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github "SDWebImage/SDWebImage" ~> 5.0
2-
github "SDWebImage/libavif-Xcode" >= 0.7.2
2+
github "SDWebImage/libavif-Xcode" >= 0.8

Example/Podfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#use_frameworks!
1+
install! 'cocoapods', :generate_multiple_pod_projects => true
22

33
target 'SDWebImageAVIFCoder_Example' do
44
platform :ios, '8.0'
@@ -7,8 +7,6 @@ target 'SDWebImageAVIFCoder_Example' do
77

88
target 'SDWebImageAVIFCoder_Tests' do
99
inherit! :search_paths
10-
11-
1210
end
1311
end
1412

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1200"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "6003F5AD195388D20070C39A"
20+
BuildableName = "SDWebImageAVIFCoder_Tests.xctest"
21+
BlueprintName = "SDWebImageAVIFCoder_Tests"
22+
ReferencedContainer = "container:SDWebImageAVIFCoder.xcodeproj">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>

Example/Tests/Tests.m

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
static UInt16 kBlue16[] = {0,0,65535};
2828
static UInt16 kSpecial16[] = {0xe4 << 8,0x7a << 8,0x8c << 8};
2929

30-
static avifNclxColourPrimaries const kNumPrimaries = AVIF_NCLX_COLOUR_PRIMARIES_EBU3213;
31-
static avifNclxTransferCharacteristics const kNumTransfers = AVIF_NCLX_TRANSFER_CHARACTERISTICS_HLG;
30+
static avifColorPrimaries const kNumPrimaries = AVIF_COLOR_PRIMARIES_EBU3213;
31+
static avifTransferCharacteristics const kNumTransfers = AVIF_TRANSFER_CHARACTERISTICS_HLG;
3232

3333

3434
// FIXME(ledyba-z): libavif does not respect MatrixCoefficients in AV1 Sequence Header.
@@ -160,8 +160,8 @@ - (void)testSpecialTest
160160

161161
-(void)testAllColorSpaceSupportsOutput
162162
{
163-
for(avifNclxColourPrimaries primaries = 0; primaries < kNumPrimaries; ++primaries) {
164-
for(avifNclxTransferCharacteristics transfer = 0; transfer < kNumTransfers; ++transfer) {
163+
for(avifColorPrimaries primaries = 0; primaries < kNumPrimaries; ++primaries) {
164+
for(avifTransferCharacteristics transfer = 0; transfer < kNumTransfers; ++transfer) {
165165
CGColorSpaceRef space = NULL;
166166

167167
space = SDAVIFCreateColorSpaceRGB(primaries, transfer);
@@ -179,12 +179,10 @@ -(void)testAllColorSpaceSupportsOutput
179179
-(void)testCalcNCLXColorSpaceFromAVIFImage
180180
{
181181
avifImage* img = avifImageCreate(100, 100, 8, AVIF_PIXEL_FORMAT_YUV420);
182-
for(avifNclxColourPrimaries primaries = 0; primaries < kNumPrimaries; ++primaries) {
183-
for(avifNclxTransferCharacteristics transfer = 0; transfer < kNumTransfers; ++transfer) {
184-
avifNclxColorProfile nclx;
185-
nclx.colourPrimaries = primaries;
186-
nclx.transferCharacteristics = transfer;
187-
avifImageSetProfileNCLX(img, &nclx);
182+
for(avifColorPrimaries primaries = 0; primaries < kNumPrimaries; ++primaries) {
183+
for(avifTransferCharacteristics transfer = 0; transfer < kNumTransfers; ++transfer) {
184+
img->colorPrimaries = primaries;
185+
img->transferCharacteristics = transfer;
188186
avifImageAllocatePlanes(img, AVIF_PLANES_YUV);
189187

190188
CGColorSpaceRef space = NULL;

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
// Dependencies declare other packages that this package depends on.
1919
// .package(url: /* package url */, from: "1.0.0"),
2020
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.1.0"),
21-
.package(url: "https://github.com/SDWebImage/libavif-Xcode.git", from: "0.7.2")
21+
.package(url: "https://github.com/SDWebImage/libavif-Xcode.git", from: "0.8.0")
2222
],
2323
targets: [
2424
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

SDWebImageAVIFCoder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ Which is built based on the open-sourced libavif codec.
3737
s.private_header_files = 'SDWebImageAVIFCoder/Classes/Private/*.{h,m}'
3838

3939
s.dependency 'SDWebImage', '~> 5.0'
40-
s.dependency 'libavif', '>= 0.7.2'
40+
s.dependency 'libavif', '>= 0.8'
4141
end

0 commit comments

Comments
 (0)