Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zunda-pixel committed Apr 9, 2023
1 parent 9375e4a commit a416be7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/Image/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,13 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
}

let maxDimensionInPixels = max(pointSize.width, pointSize.height) * scale
let downsampleOptions = [
let downsampleOptions: [CFString : Any] = [
kCGImageSourceCreateThumbnailFromImageAlways: true,
kCGImageSourceShouldCacheImmediately: true,
kCGImageSourceCreateThumbnailWithTransform: true,
kCGImageSourceThumbnailMaxPixelSize: maxDimensionInPixels] as CFDictionary
guard let downsampledImage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, downsampleOptions) else {
kCGImageSourceThumbnailMaxPixelSize: maxDimensionInPixels
]
guard let downsampledImage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, downsampleOptions as CFDictionary) else {
return nil
}
return KingfisherWrapper.image(cgImage: downsampledImage, scale: scale, refImage: nil)
Expand Down

0 comments on commit a416be7

Please sign in to comment.