From 9348ad305b4741a549c6329766fad0dbf260c8aa Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 14 Jun 2023 21:19:40 +0800 Subject: [PATCH] Bumped version to 0.12.0 --- Package.resolved | 4 ++-- README.md | 22 ++++++++++++++++++++++ SDWebImageWebPCoder.podspec | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 1f5343b..14db6ef 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/SDWebImage/SDWebImage.git", "state": { "branch": null, - "revision": "fb50c1d20f24db5322b2f8f379de3618f75fe08e", - "version": "5.15.5" + "revision": "c51ba84499268ea3020e6aee9e229c0f56b9d924", + "version": "5.16.0" } } ] diff --git a/README.md b/README.md index ce7ad06..73b3494 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,28 @@ let thumbnailSize = CGSize(width: 300, height: 300) 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 + Objective-c diff --git a/SDWebImageWebPCoder.podspec b/SDWebImageWebPCoder.podspec index ec7eb77..7550d32 100644 --- a/SDWebImageWebPCoder.podspec +++ b/SDWebImageWebPCoder.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SDWebImageWebPCoder' - s.version = '0.11.0' + s.version = '0.12.0' s.summary = 'WebP decoder/encoder for SDWebImage coder plugin.' s.description = <<-DESC