Skip to content

Commit 0375da1

Browse files
authored
Merge pull request #30 from SDWebImage/support_libavif_0.9.1
Support libavif 0.9.1
2 parents e5dc92d + 7bba93f commit 0375da1

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

.github/workflows/check-image-decoding.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ jobs:
3232
CMD="../Example/CLI.xcarchive/Products/usr/local/bin/SDWebImageAVIFCoder_Example CLI"
3333
for file in $(find . -name \*.avif); do
3434
file=$(basename ${file})
35-
if (echo ${file} | grep "\(monochrome\|crop\|rotate\|mirror\)"); then
36-
# FIXME(ledyba-z): Check them.
37-
echo "Ignore: ${file}"
38-
continue
39-
elif (echo ${file} | grep "profile"); then
35+
if (echo ${file} | grep "profile"); then
4036
# FIXME(ledyba-z): https://github.com/SDWebImage/SDWebImageAVIFCoder/issues/21
4137
echo "Ignore: ${file}"
4238
continue
@@ -58,11 +54,7 @@ jobs:
5854
cd avif-sample-images
5955
for file in $(find . -name \*.avif); do
6056
file=$(basename ${file})
61-
if (echo ${file} | grep "\(monochrome\|crop\|rotate\|mirror\)"); then
62-
# FIXME(ledyba-z): Check them.
63-
echo "Ignore: ${file}"
64-
continue
65-
elif (echo ${file} | grep "profile"); then
57+
if (echo ${file} | grep "profile"); then
6658
# FIXME(ledyba-z): https://github.com/SDWebImage/SDWebImageAVIFCoder/issues/21
6759
echo "Ignore: ${file}"
6860
continue

Cartfile

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

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.10.0"),
21-
.package(url: "https://github.com/SDWebImage/libavif-Xcode.git", from: "0.8.2")
21+
.package(url: "https://github.com/SDWebImage/libavif-Xcode.git", from: "0.9.1")
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
@@ -40,6 +40,6 @@ Which is built based on the open-sourced libavif codec.
4040
}
4141

4242
s.dependency 'SDWebImage', '~> 5.10'
43-
s.dependency 'libavif', '>= 0.8.2'
43+
s.dependency 'libavif', '>= 0.9.1'
4444
s.libraries = 'c++'
4545
end

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ - (nullable CGImageRef)sd_createAVIFImageWithData:(nonnull NSData *)data CF_RETU
6464
// Decode it
6565
avifDecoder * decoder = avifDecoderCreate();
6666
avifDecoderSetIOMemory(decoder, data.bytes, data.length);
67+
// Disable strict mode to keep some AVIF image compatible
68+
decoder->strictFlags = AVIF_STRICT_DISABLED;
6769
avifResult decodeResult = avifDecoderParse(decoder);
6870
if (decodeResult != AVIF_RESULT_OK) {
6971
NSLog(@"Failed to decode image: %s", avifResultToString(decodeResult));

0 commit comments

Comments
 (0)