Skip to content

8.17.0 - Bright Side

Latest

Choose a tag to compare

@onevcat onevcat released this 28 Nov 14:33
8.17.0

Add

  • Add an opt-in .preferHighDynamicRange option and preferHighDynamicRange(_:) setter to decode images with a gain map (such as photos from recent iPhones and Ultra HDR JPEGs) as HDR on iOS 17, tvOS 17 and visionOS 1 or later. The HDR content is kept through downsampling, background decoding, the disk cache, and the drawing and Core Image processors. On macOS, the gain map of an HDR image is now kept when the image is stored to the disk cache. #2647 #2648 #2650 #2328 #2137 @onevcat @CloudlessMoon @jerrellmardis
  • Add the .onDataReceived option and the onDataReceived(_:) setter to observe each chunk of image data that ImageDownloader receives. Handlers add up with the ones in defaultOptions, and a stale request is not called. #2640 #2635 #2118 @shubhransh-gupta
  • Add static async ImagePrefetcher.prefetch(urls:), prefetch(resources:) and prefetch(sources:) methods that return an ImagePrefetchResult and stop the prefetching when the task is cancelled. #2633 @shubhransh-gupta
  • Add AsyncAnyModifier and an async requestModifier(onDownloadTaskStarted:_:) setter, to modify the download request with an async closure. #2629 @shubhransh-gupta
  • Add border(_:), border(color:lineWidth:radius:roundingCorners:) and colorControls(brightness:contrast:saturation:inputEV:) to KFOptionSetter, so KF.Builder, KFImage and KFAnimatedImage can chain these processors. #2642 #2631 @shubhransh-gupta
  • Add a writeOptions parameter to ImageCache.storeToDisk, and apply .diskStoreWriteOptions also to the original image stored by .cacheOriginalImage. #2628 @shubhransh-gupta

Fix

  • Return a cancellable DownloadTask when an AsyncImageDownloadRequestModifier is used. Before, retrieveImage returned nil, so cancelDownloadTask() and KFImage could not stop the download. #2645 @onevcat
  • Use a full-precision and stable color identifier in BorderImageProcessor, TintImageProcessor, OverlayImageProcessor, BlendImageProcessor and CompositingImageProcessor, so close colors no longer share a cache key and a pattern color no longer crashes on macOS. The cache keys of these processors change, so images cached with them are processed again once. #2639 #2632 @shubhransh-gupta
  • Apply the alpha of the border color only once in addingBorder(_:) and BorderImageProcessor. #2626 @unaltolga
  • Draw the solid overlay color at fraction 0 in overlaying(with:fraction:) and OverlayImageProcessor on macOS, the same as on iOS. #2625 @unaltolga
  • Fix blurred(withRadius:) and BlurImageProcessor dropping the second box blur pass for a small radius. #2636 @unaltolga
  • Fall back to an RGB context on macOS when a bitmap context cannot use the image's format, such as a 16-bit gray image with alpha, so decoding and the drawing processors no longer fail for it. #2641 @unaltolga
  • Use the pixel size of the backing CGImage to compute the memory cost of an image made with NSImage(cgImage:size:) on macOS. #2652 #2651 @xinnjie
  • Use the pixel size of the backing CGImage for kf.size of an image made with NSImage(cgImage:size:) on macOS, so crop, blur and the drawing processors give correct results on Retina displays. #2654 @onevcat
  • Throw .diskStorageIsNotReady from the size, cleaning and removal methods of DiskStorage when the storage is not ready, instead of reporting a size of 0 or a raw file system error. #2634 @shubhransh-gupta
  • Always call the completion handler of calculateDiskStorageSize and the disk cache retrieving when an unexpected error happens. #2630 @shubhransh-gupta

Remove

  • Stop the CocoaPods distribution. 8.16.0 is the last version on CocoaPods. New versions are available through Swift Package Manager and the pre-built XCFramework on GitHub Releases. #2624 @onevcat