Skip to content

Commit a65d37c

Browse files
committed
Update the Readme about thumbnail decoding.
1 parent d77570d commit a65d37c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,26 @@ let webpData: Data
124124
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: nil)
125125
```
126126

127+
### Thumbnail Decoding
128+
129+
+ Objective-C
130+
131+
```objective-c
132+
// WebP thumbnail image decoding
133+
NSData *webpData;
134+
CGSize thumbnailSize = CGSizeMake(300, 300);
135+
UIImage *thumbnailImage = [[SDImageWebPCoder sharedCoder] decodedImageWithData:webpData options:@{SDImageCoderDecodeThumbnailPixelSize : @(thumbnailSize}];
136+
```
137+
138+
+ Swift
139+
140+
```swift
141+
// WebP thumbnail image decoding
142+
let webpData: Data
143+
let thumbnailSize = CGSize(width: 300, height: 300)
144+
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeThumbnailPixelSize: thumbnailSize])
145+
```
146+
127147
### Encoding
128148

129149
+ Objective-c

0 commit comments

Comments
 (0)