Skip to content

Commit 542efa8

Browse files
committed
Add the Carthage support
1 parent faa331d commit 542efa8

File tree

9 files changed

+518
-17
lines changed

9 files changed

+518
-17
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ DerivedData
2323
.bundle
2424

2525
# Add this line if you want to avoid checking in source code from Carthage dependencies.
26-
# Carthage/Checkouts
27-
26+
Carthage/Checkouts
2827
Carthage/Build
2928

3029
# We recommend against adding the Pods directory to your .gitignore. However

Cartfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github "SDWebImage/SDWebImage" ~> 5.0
2+
github "SDWebImage/libavif-Xcode"

Cartfile.resolved

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github "SDWebImage/SDWebImage" "5.0.1"
2+
github "SDWebImage/libaom-Xcode" "1.0.0"
3+
github "SDWebImage/libavif-Xcode" "0.1.0"

Example/SDWebImageAVIFCoder_Example macOS/Base.lproj/Main.storyboard

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
56
</dependencies>
67
<scenes>
78
<!--Application-->
@@ -673,7 +674,7 @@
673674
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
674675
</connections>
675676
</application>
676-
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider=""/>
677+
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
677678
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
678679
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
679680
</objects>
@@ -703,7 +704,7 @@
703704
<!--View Controller-->
704705
<scene sceneID="hIz-AP-VOD">
705706
<objects>
706-
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
707+
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
707708
<view key="view" id="m2S-Jp-Qdl">
708709
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
709710
<autoresizingMask key="autoresizingMask"/>

Example/Screenshot/AVIFDemo-iOS.png

2.18 MB
Loading

Example/Screenshot/AVIFDemo-macOS.png

742 KB
Loading

README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,88 @@
11
# SDWebImageAVIFCoder
22

3-
[![CI Status](https://img.shields.io/travis/[email protected]/SDWebImageAVIFCoder.svg?style=flat)](https://travis-ci.org/[email protected]/SDWebImageAVIFCoder)
3+
[![CI Status](https://img.shields.io/travis/SDWebImage/SDWebImageAVIFCoder.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImageAVIFCoder)
44
[![Version](https://img.shields.io/cocoapods/v/SDWebImageAVIFCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageAVIFCoder)
55
[![License](https://img.shields.io/cocoapods/l/SDWebImageAVIFCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageAVIFCoder)
66
[![Platform](https://img.shields.io/cocoapods/p/SDWebImageAVIFCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageAVIFCoder)
7+
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImageAVIFCoder)
78

8-
## Example
9+
## What's for
910

10-
To run the example project, clone the repo, and run `pod install` from the Example directory first.
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.
12+
13+
This AVIF coder plugin currently support AVIF still image **decoding**. Including alpha channel, as well as 10bit/12bit HDR images.
14+
15+
The AVIF encoding is not currently support, because the software-based encoding speed is really slow. Need to wait for better enc implementation.
16+
17+
Note: AVIF image spec is still in evolve. And the current AVIF codec is a simple implementation.
18+
19+
Since AVIF is AV1-based inside HEIF image container. In the future, this repo may moved to existing HEIF coder plugin [SDWebImageHEIFCoder](https://github.com/SDWebImage/SDWebImageHEIFCoder) instead.
1120

1221
## Requirements
1322

23+
+ iOS 8
24+
+ tvOS 9.0
25+
+ macOS 10.10
26+
+ watchOS 2.0
27+
1428
## Installation
1529

30+
#### CocoaPods
1631
SDWebImageAVIFCoder is available through [CocoaPods](https://cocoapods.org). To install
1732
it, simply add the following line to your Podfile:
1833

1934
```ruby
2035
pod 'SDWebImageAVIFCoder'
2136
```
2237

38+
#### Carthage
39+
40+
SDWebImageAVIFCoder is available through [Carthage](https://github.com/Carthage/Carthage).
41+
42+
```
43+
github "SDWebImage/SDWebImageAVIFCoder"
44+
```
45+
46+
## Usage
47+
48+
To use AVIF coder, you should firstly add the `SDImageAVIFCoder.sharedCoder` to the coders manager. Then you can call the View Category method to start load AVIF images.
49+
50+
+ Objective-C
51+
52+
```objective-c
53+
SDImageAVIFCoder *AVIFCoder = SDImageAVIFCoder.sharedCoder;
54+
[[SDImageCodersManager sharedManager] addCoder:AVIFCoder];
55+
UIImageView *imageView;
56+
[imageView sd_setImageWithURL:url];
57+
```
58+
59+
+ Swift
60+
61+
```swift
62+
let AVIFCoder = SDImageAVIFCoder.shared
63+
SDImageCodersManager.shared.addCoder(AVIFCoder)
64+
let imageView: UIImageView
65+
imageView.sd_setImage(with: url)
66+
```
67+
68+
## Screenshot
69+
70+
<img src="https://raw.githubusercontent.com/SDWebImage/SDWebImageAVIFCoder/master/Example/Screenshot/AVIFDemo.png" width="300" />
71+
<img src="https://raw.githubusercontent.com/SDWebImage/SDWebImageAVIFCoder/master/Example/Screenshot/AVIFDemo-macOS.png" width="600" />
72+
73+
The images are from [AV1 Still Image File Format Specification](https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles)
74+
2375
## Author
2476

25-
77+
DreamPiggy, [email protected]
2678

2779
## License
2880

2981
SDWebImageAVIFCoder is available under the MIT license. See the LICENSE file for more info.
82+
83+
## Thanks
84+
85+
+ [libavif](https://github.com/joedrago/avif)
86+
+ [aom](https://aomedia.googlesource.com/aom/)
87+
88+

0 commit comments

Comments
 (0)