From 92e55d4fd6086603e27a1d8d46f9b5d66a801d3b Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Tue, 7 Apr 2020 20:59:03 +0800 Subject: [PATCH] Bumped version to 0.6.0 Update the README --- README.md | 9 +++++++-- SDWebImageWebPCoder.podspec | 2 +- SDWebImageWebPCoder/Module/Info.plist | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c90bf8..d7b1082 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,9 @@ let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeTh // WebP image encoding UIImage *image; NSData *webpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:nil]; +// Encode Quality +NSData *lossyWebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:@{SDImageCoderEncodeCompressionQuality : @(0.1)}]; // [0, 1] compression quality +NSData *limitedWebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:@{SDImageCoderEncodeMaxFileSize : @(1024 * 10)}]; // v0.6.0 feature, limit output file size <= 10KB ``` + Swift @@ -183,15 +186,17 @@ NSData *webpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image fo // WebP image encoding let image: UIImage let webpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: nil) +let lossyWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeCompressionQuality: 0.1]) // [0, 1] compression quality +let limitedWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeMaxFileSize: 1024 * 10]) // v0.6.0 feature, limit output file size <= 10KB ``` See more documentation in [SDWebImage Wiki - Coders](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-coder-420) ## Example -To run the example project, clone the repo, and run `pod install` from the Example directory first. +To run the example project, clone the repo, and run `pod install` from the root directory first. Then open `SDWebImageWebPCoder.xcworkspace`. -This is a demo to show how to use `WebP` and animated `WebP` images via `SDWebImage`. +This is a demo to show how to use `WebP` and animated `WebP` images via `SDWebImageWebPCoderExample` target. ## Screenshot diff --git a/SDWebImageWebPCoder.podspec b/SDWebImageWebPCoder.podspec index 7f29ea7..d645726 100644 --- a/SDWebImageWebPCoder.podspec +++ b/SDWebImageWebPCoder.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SDWebImageWebPCoder' - s.version = '0.5.0' + s.version = '0.6.0' s.summary = 'WebP decoder/encoder for SDWebImage coder plugin.' s.description = <<-DESC diff --git a/SDWebImageWebPCoder/Module/Info.plist b/SDWebImageWebPCoder/Module/Info.plist index 122cbeb..30cf2e7 100644 --- a/SDWebImageWebPCoder/Module/Info.plist +++ b/SDWebImageWebPCoder/Module/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.0 + 0.6.0 CFBundleVersion - 0.5.0 + 0.6.0 NSPrincipalClass