Repository navigation
Nuke 13.1.0
What's Changed
- Fix
GaussianBlurcrash on grayscale images by @Delarkz in kean#880 - Fix cache initialization for mergeable libraries by @ZHUOLIN0928 in kean#881
- Add asynchronous image decoding support by @thliu21 in kean#879
- Add
ImageDecoderRegistry.unregister(_:).register(_:)now returns a discardableRegistrationTokenfor removing an individual decoder instead of clearing the entire registry ImageDecoderRegistry.register(_:)now takes a@Sendableclosure. The registry is shared between the pipelines and the closures are called on the decoding threads- Fix a data race in
ImageDecoderRegistrywheredecoder(for:)iterated the registered decoders without holding the lock. The registry is now backed byMutexand isSendableinstead of@unchecked Sendable - Fix a leak where requests that finish synchronously (memory cache hits, disk cache hits for
data(for:), local resources,.returnCacheDataDontLoadmisses, and malformed URLs) were never removed from the pipeline, retaining their responses for its lifetime - Fix
ImageTask.Event.startedbeing delivered toImagePipeline.Delegateafter.finishedfor requests that finish synchronously - Fix
DataLoadercallingcompletiontwice when response validation fails, violating theDataLoadingcontract - Fix a request cancelled while
ImagePipeline.Delegate.willLoadData(for:urlRequest:pipeline:)was suspended still running the download to completion, discarding the result and occupying a slot indataLoadingQueue - Fix resumable data being lost when a request ended before the server responded. It's now put back if nothing new was downloaded
- Fix requests with
ImageRequest.Options.skipDataLoadingQueuenot cancelling the underlyingTask, leaving an asyncwillLoadDataor a customdatafetch closure running after cancellation - Fix progressive previews being permanently disabled when the first downloaded chunk isn't enough to tell that the image supports them, which is common for progressive JPEGs with large EXIF/ICC preambles. The policy is now re-evaluated as more data arrives, but only until it starts producing previews and with a hard cap on the number of attempts
- Fix
ImageDecoders.Emptynot marking the containers returned bydecodePartiallyDownloadedData(_:)as previews, so the truncated data was stored in the caches and delivered as a completed response on the subsequent cache hits - Fix
ImageProcessors.CoreImageFiltersharing a single mutableCIFilterbetween concurrently processed images.CIFilteris not thread-safe, so the processor could produce an image from another request's input and cache it under the wrong key. It now applies a copy of the filter - Fix the screen scale used by
ImageProcessingOptions.Unit.pointsbeing read once and cached for the lifetime of the process.UITraitCollection.currentreports a0display scale outside of the contexts managed by UIKit, so if the first points-basedImageRequestwas created on a background thread, every subsequent resize failed withprocessingFailedand the point-based border widths and corner radii became0 - Fix a crash on macOS when an
ImageProcessingOptions.Borderis created with anNSColoroutside an RGB colorspace, including.black,.white, and the catalog colors such as.labelColor. UnlikeUIColor,NSColorraises fromgetRed(_:green:blue:alpha:)instead of converting on the fly, so merely reading the processoridentifierterminated the process. The color is now converted to sRGB first - Fix
ImagePrefetcher.stopPrefetching(with:)andImagePrefetcher.stopPrefetching()doing nothing for the prefetches that were scheduled but haven't started yet. In the standard collection view pattern, the requests ran the entire download/decode/cache cycle anyway - Fix
ImagePrefetcher.prioritynot reaching the prefetches that were scheduled but haven't started yet. They kept the priority frozen in their original requests and eventually did the actual work at the old priority - Fix the async/await variant of
FetchImage.load(_:)delivering a result after the load was cancelled or superseded, overwriting the state of the newer load - Fix
LazyImagewith thelowerPrioritydisappear behavior permanently lowering the priority of its requests after the view goes off-screen. The override wasn't reset when the view reappeared - Fix
LazyImageViewstacking the views created bymakeImageView. A view was added for every displayed response without removing the previous one, so the orphaned views survived cell reuse, covered the newer content, and retained their images
New Contributors
- @Delarkz made their first contribution in kean#880
- @ZHUOLIN0928 made their first contribution in kean#881
- @thliu21 made their first contribution in kean#879
Full Changelog: kean/Nuke@13.0.6...13.1.0