Skip to content

Commit 7d67356

Browse files
committed
Fix the compatible for libavif 1.0.4 version. Which use YUV as default and no RGB plane is decoded, unless you call.
1 parent 1887944 commit 7d67356

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
github "SDWebImage/SDWebImage" "5.0.2"
1+
github "SDWebImage/SDWebImage" "5.1.0"
22
github "SDWebImage/libaom-Xcode" "1.0.1"
3-
github "SDWebImage/libavif-Xcode" "0.1.3"
3+
github "SDWebImage/libavif-Xcode" "0.1.4"

Example/Podfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
PODS:
22
- libaom (1.0.1)
3-
- libavif (0.1.3):
3+
- libavif (0.1.4):
44
- libaom (>= 1.0.1)
5-
- SDWebImage (5.0.2):
6-
- SDWebImage/Core (= 5.0.2)
7-
- SDWebImage/Core (5.0.2)
8-
- SDWebImageAVIFCoder (0.1.0):
9-
- libavif (>= 0.1.3)
5+
- SDWebImage (5.1.0):
6+
- SDWebImage/Core (= 5.1.0)
7+
- SDWebImage/Core (5.1.0)
8+
- SDWebImageAVIFCoder (0.2.0):
9+
- libavif (~> 0.1.4)
1010
- SDWebImage (~> 5.0)
1111

1212
DEPENDENCIES:
@@ -24,10 +24,10 @@ EXTERNAL SOURCES:
2424

2525
SPEC CHECKSUMS:
2626
libaom: 1e48c68559b8d6191c1a9f266e0bee83b2dd21fd
27-
libavif: b6de15e6a91a347806b2fcc1fccd471c821f6d6a
28-
SDWebImage: 6764b5fa0f73c203728052955dbefa2bf1f33282
29-
SDWebImageAVIFCoder: 1e80598038f37e20a83a7a790cb192e0b362a557
27+
libavif: 4f94ed672d45d6651ee0f784f5faf11b95449716
28+
SDWebImage: fb387001955223213dde14bc08c8b73f371f8d8f
29+
SDWebImageAVIFCoder: ec08ff2cf12552223b51b7253c8201d264ecbbac
3030

3131
PODFILE CHECKSUM: cb60778bff8fb5ce4fbc8792f6079317b7a897be
3232

33-
COCOAPODS: 1.6.1
33+
COCOAPODS: 1.7.5

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## What's for
1010

11-
This is a [SDWebImage](https://github.com/rs/SDWebImage) coder plugin to add [AV1 Image File Format (AVIF)](https://aomediacodec.github.io/av1-avif/) support. Which is built based on the open-sourced [libavif](https://github.com/joedrago/avif) codec.
11+
This is a [SDWebImage](https://github.com/rs/SDWebImage) coder plugin to add [AV1 Image File Format (AVIF)](https://aomediacodec.github.io/av1-avif/) support. Which is built based on the open-sourced [libavif](https://github.com/AOMediaCodec/libavif) codec.
1212

1313
This AVIF coder plugin currently support AVIF still image **decoding**. Including alpha channel, as well as 10bit/12bit HDR images.
1414

@@ -92,7 +92,7 @@ SDWebImageAVIFCoder is available under the MIT license. See the LICENSE file for
9292

9393
## Thanks
9494

95-
+ [libavif](https://github.com/joedrago/avif)
95+
+ [libavif](https://github.com/AOMediaCodec/libavif)
9696
+ [aom](https://aomedia.googlesource.com/aom/)
9797
+ [AVIFQuickLook](https://github.com/dreampiggy/AVIFQuickLook)
9898
+ [avif.js](https://github.com/Kagami/avif.js)

SDWebImageAVIFCoder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ Which is built based on the open-sourced libavif codec.
3636
s.source_files = 'SDWebImageAVIFCoder/Classes/**/*', 'SDWebImageAVIFCoder/Module/SDWebImageAVIFCoder.h'
3737

3838
s.dependency 'SDWebImage', '~> 5.0'
39-
s.dependency 'libavif', '>= 0.1.3'
39+
s.dependency 'libavif', '~> 0.1.4'
4040
end

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ - (nullable CGImageRef)sd_createAVIFImageWithData:(nonnull NSData *)data CF_RETU
134134
return nil;
135135
}
136136

137+
// use RGB instead of YUV
138+
avifImageYUVToRGB(avif);
139+
137140
int width = avif->width;
138141
int height = avif->height;
139142
BOOL hasAlpha = avif->alphaPlane != NULL;

0 commit comments

Comments
 (0)