diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index aba68f86..cbe7e161 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ * [ ] I have run the tests and they pass * [ ] I have run the lint and it passes (`pod lib lint`) -This merge request fixes / reffers to the following issues: ... +This merge request fixes / refers to the following issues: ... ### Pull Request Description diff --git a/CHANGELOG.md b/CHANGELOG.md index c923ac54..7f65fc05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## [5.0.0-beta5 - Customizable SDWebImage, on Jan 31st, 2019](https://github.com/rs/SDWebImage/releases/tag/5.0.0-beta5) +See [all tickets marked for the 5.0.0-beta5 release](https://github.com/rs/SDWebImage/milestone/32) + +#### Fixes +- Fix encoding options does not works #2602 +- Remove unnecessary CGImage check when encode first frame #2609 + +## [4.4.5 - 4.4 patch, on Jan 31st, 2019](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.5) +See [all tickets marked for the 4.4.5 release](https://github.com/SDWebImage/SDWebImage/milestone/31) + +#### Fixes +- Revert the modular framework, try to fix some user's install issue when using SDWebImage in prefix header #2604 +- Fix wrong decompression scale calculation #2608 +- Fix shouldDecode check when image format is GIF #2606 +- Fix modify data pointer if webp image scaled down #2607 + ## [5.0.0-beta4 - Customizable SDWebImage, on Jan 26th, 2019](https://github.com/rs/SDWebImage/releases/tag/5.0.0-beta4) See [all tickets marked for the 5.0.0 release](https://github.com/rs/SDWebImage/milestone/15) diff --git a/README.md b/README.md index 8af3434f..3f321277 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ This library provides an async image downloader with cache support. For convenie - Image formats supported by UIImage (JPEG, PNG, ...), including GIF - WebP format, including animated WebP (use the [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) project) +- Support extendable coder plugins for new image formats. Like APNG, BPG, HFIF, SVG, etc. See all the list in [Image coder plugin List](https://github.com/SDWebImage/SDWebImage/wiki/Coder-Plugin-List) ## Additional modules @@ -58,6 +59,12 @@ As such, we have moved/built new modules to [SDWebImage org](https://github.com/ You can use those directly, or create similar components of your own. +## Beta version + +SDWebImage's 5.0 version is nearing completion. Which introduce many new features like Animated ImageView and Transformer. We also provide a more modularized design used for advanced user customization. + +You can check the latest [5.x branch](https://github.com/SDWebImage/SDWebImage/tree/5.x) to know about the current status. We'd love you to have a try with the beta version and provide any feedback. If you'd love, check [SDWebImage 5.0 Migration Guide](https://github.com/SDWebImage/SDWebImage/wiki/5.0-Migration-guide) and prepare for the migration. + ## Requirements - iOS 8.0 or later @@ -142,19 +149,27 @@ platform :ios, '7.0' pod 'SDWebImage', '~> 4.0' ``` -##### Swift +##### Swift and static framework -If you are using `Swift`, `Xcode 9+` and `CocoaPods` `1.5.0+`, you only need to set your target to `iOS 8+` if you need static library: +Swift project previously have to use `use_frameworks!` to make all Pods into dynamic framework to let CocoaPods works. + +However, start with `CocoaPods 1.5.0+` (with `Xcode 9+`), which supports to build both Objective-C && Swift code into static framework. You can use modular headers to use SDWebImage as static framework, without the need of `use_frameworks!`: ``` platform :ios, '8.0' +# Uncomment the next line when you want all Pods as static framework +# use_modular_headers! +pod 'SDWebImage', :modular_headers => true ``` -If not, you still need to add `use_frameworks!` to use dynamic framework: +See more on [CocoaPods 1.5.0 — Swift Static Libraries](http://blog.cocoapods.org/CocoaPods-1.5.0/) + +If not, you still need to add `use_frameworks!` to use SDWebImage as dynamic framework: ``` platform :ios, '8.0' use_frameworks! +pod 'SDWebImage' ``` #### Subspecs diff --git a/SDWebImage.podspec b/SDWebImage.podspec index 05d9f157..047d236e 100644 --- a/SDWebImage.podspec +++ b/SDWebImage.podspec @@ -24,7 +24,6 @@ Pod::Spec.new do |s| s.requires_arc = true s.framework = 'ImageIO' s.module_map = 'WebImage/SDWebImage.modulemap' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.default_subspec = 'Core' diff --git a/SDWebImage/SDImageCoderHelper.m b/SDWebImage/SDImageCoderHelper.m index a0e741a4..7a75eb0c 100644 --- a/SDWebImage/SDImageCoderHelper.m +++ b/SDWebImage/SDImageCoderHelper.m @@ -326,14 +326,14 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over CGSize sourceResolution = CGSizeZero; sourceResolution.width = CGImageGetWidth(sourceImageRef); sourceResolution.height = CGImageGetHeight(sourceImageRef); - float sourceTotalPixels = sourceResolution.width * sourceResolution.height; + CGFloat sourceTotalPixels = sourceResolution.width * sourceResolution.height; // Determine the scale ratio to apply to the input image // that results in an output image of the defined size. // see kDestImageSizeMB, and how it relates to destTotalPixels. - float imageScale = destTotalPixels / sourceTotalPixels; + CGFloat imageScale = sqrt(destTotalPixels / sourceTotalPixels); CGSize destResolution = CGSizeZero; - destResolution.width = (int)(sourceResolution.width*imageScale); - destResolution.height = (int)(sourceResolution.height*imageScale); + destResolution.width = (int)(sourceResolution.width * imageScale); + destResolution.height = (int)(sourceResolution.height * imageScale); // device color space CGColorSpaceRef colorspaceRef = [self colorSpaceGetDeviceRGB];