Bumped version to 0.12.0

This commit is contained in:
DreamPiggy 2023-06-14 21:19:40 +08:00
parent f4c09076d1
commit 9348ad305b
3 changed files with 25 additions and 3 deletions

View File

@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/SDWebImage/SDWebImage.git", "repositoryURL": "https://github.com/SDWebImage/SDWebImage.git",
"state": { "state": {
"branch": null, "branch": null,
"revision": "fb50c1d20f24db5322b2f8f379de3618f75fe08e", "revision": "c51ba84499268ea3020e6aee9e229c0f56b9d924",
"version": "5.15.5" "version": "5.16.0"
} }
} }
] ]

View File

@ -168,6 +168,28 @@ let thumbnailSize = CGSize(width: 300, height: 300)
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeThumbnailPixelSize: thumbnailSize]) let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeThumbnailPixelSize: thumbnailSize])
``` ```
### Decoding with limit bytes (0.12.0+)
+ Objective-C
```objective-c
// WebP thumbnail image decoding
NSData *webpData;
NSUInteger limitBytes = 1024 * 1024; // 1MB
UIImage *image = [[SDImageWebPCoder sharedCoder] decodedImageWithData:webpData options:@{SDImageCoderDecodeScaleDownLimitBytes : @(limitBytes)}];
// The image pixel buffer is guaranteed to less than 1MB in RAM (may scale down or full size), suitable for large image
```
+ Swift
```swift
// WebP thumbnail image decoding
let webpData: Data
let limitBytes = 1024 * 1024 // 1MB
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeScaleDownLimitBytes: limitBytes])
// The image pixel buffer is guaranteed to less than 1MB in RAM (may scale down or full size), suitable for large image
```
### Encoding ### Encoding
+ Objective-c + Objective-c

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'SDWebImageWebPCoder' s.name = 'SDWebImageWebPCoder'
s.version = '0.11.0' s.version = '0.12.0'
s.summary = 'WebP decoder/encoder for SDWebImage coder plugin.' s.summary = 'WebP decoder/encoder for SDWebImage coder plugin.'
s.description = <<-DESC s.description = <<-DESC