Skip to content

Commit

Permalink
Merge pull request #2 from SDWebImage/bugfix_libavif_compatible
Browse files Browse the repository at this point in the history
Fix the compatible for libavif 1.0.4 version
  • Loading branch information
dreampiggy authored Aug 21, 2019
2 parents 1887944 + 7d67356 commit 45e0d91
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "SDWebImage/SDWebImage" "5.0.2"
github "SDWebImage/SDWebImage" "5.1.0"
github "SDWebImage/libaom-Xcode" "1.0.1"
github "SDWebImage/libavif-Xcode" "0.1.3"
github "SDWebImage/libavif-Xcode" "0.1.4"
20 changes: 10 additions & 10 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- libaom (1.0.1)
- libavif (0.1.3):
- libavif (0.1.4):
- libaom (>= 1.0.1)
- SDWebImage (5.0.2):
- SDWebImage/Core (= 5.0.2)
- SDWebImage/Core (5.0.2)
- SDWebImageAVIFCoder (0.1.0):
- libavif (>= 0.1.3)
- SDWebImage (5.1.0):
- SDWebImage/Core (= 5.1.0)
- SDWebImage/Core (5.1.0)
- SDWebImageAVIFCoder (0.2.0):
- libavif (~> 0.1.4)
- SDWebImage (~> 5.0)

DEPENDENCIES:
Expand All @@ -24,10 +24,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
libaom: 1e48c68559b8d6191c1a9f266e0bee83b2dd21fd
libavif: b6de15e6a91a347806b2fcc1fccd471c821f6d6a
SDWebImage: 6764b5fa0f73c203728052955dbefa2bf1f33282
SDWebImageAVIFCoder: 1e80598038f37e20a83a7a790cb192e0b362a557
libavif: 4f94ed672d45d6651ee0f784f5faf11b95449716
SDWebImage: fb387001955223213dde14bc08c8b73f371f8d8f
SDWebImageAVIFCoder: ec08ff2cf12552223b51b7253c8201d264ecbbac

PODFILE CHECKSUM: cb60778bff8fb5ce4fbc8792f6079317b7a897be

COCOAPODS: 1.6.1
COCOAPODS: 1.7.5
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## What's for

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.
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.

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

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

## Thanks

+ [libavif](https://github.com/joedrago/avif)
+ [libavif](https://github.com/AOMediaCodec/libavif)
+ [aom](https://aomedia.googlesource.com/aom/)
+ [AVIFQuickLook](https://github.com/dreampiggy/AVIFQuickLook)
+ [avif.js](https://github.com/Kagami/avif.js)
Expand Down
2 changes: 1 addition & 1 deletion SDWebImageAVIFCoder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ Which is built based on the open-sourced libavif codec.
s.source_files = 'SDWebImageAVIFCoder/Classes/**/*', 'SDWebImageAVIFCoder/Module/SDWebImageAVIFCoder.h'

s.dependency 'SDWebImage', '~> 5.0'
s.dependency 'libavif', '>= 0.1.3'
s.dependency 'libavif', '~> 0.1.4'
end
3 changes: 3 additions & 0 deletions SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ - (nullable CGImageRef)sd_createAVIFImageWithData:(nonnull NSData *)data CF_RETU
return nil;
}

// use RGB instead of YUV
avifImageYUVToRGB(avif);

int width = avif->width;
int height = avif->height;
BOOL hasAlpha = avif->alphaPlane != NULL;
Expand Down

0 comments on commit 45e0d91

Please sign in to comment.