@@ -47,6 +47,7 @@ import UniformTypeIdentifiers
47
47
nonisolated ( unsafe) private let animatedImageDataKey = malloc ( 1 ) !
48
48
nonisolated ( unsafe) private let imageFrameCountKey = malloc ( 1 ) !
49
49
nonisolated ( unsafe) private let imageSourceKey = malloc ( 1 ) !
50
+ nonisolated ( unsafe) private let imageCreatingOptionsKey = malloc ( 1 ) !
50
51
#if os(macOS)
51
52
nonisolated ( unsafe) private let imagesKey = malloc ( 1 ) !
52
53
nonisolated ( unsafe) private let durationKey = malloc ( 1 ) !
@@ -55,6 +56,7 @@ nonisolated(unsafe) private let durationKey = malloc(1)!
55
56
private let animatedImageDataKey = malloc ( 1 ) !
56
57
private let imageFrameCountKey = malloc ( 1 ) !
57
58
private let imageSourceKey = malloc ( 1 ) !
59
+ private let imageCreatingOptionsKey = malloc ( 1 ) !
58
60
#if os(macOS)
59
61
private let imagesKey = malloc ( 1 ) !
60
62
private let durationKey = malloc ( 1 ) !
@@ -68,6 +70,11 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
68
70
set { setRetainedAssociatedObject ( base, animatedImageDataKey, newValue) }
69
71
}
70
72
73
+ private( set) var imageCreatingOptions : ImageCreatingOptions ? {
74
+ get { return getAssociatedObject ( base, imageCreatingOptionsKey) }
75
+ set { setRetainedAssociatedObject ( base, imageCreatingOptionsKey, newValue) }
76
+ }
77
+
71
78
public var imageFrameCount : Int ? {
72
79
get { return getAssociatedObject ( base, imageFrameCountKey) }
73
80
set { setRetainedAssociatedObject ( base, imageFrameCountKey, newValue) }
@@ -359,6 +366,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
359
366
image? . kf. animatedImageData = source. data
360
367
image? . kf. imageFrameCount = source. frameCount
361
368
image? . kf. frameSource = source
369
+ image? . kf. imageCreatingOptions = options
362
370
return image
363
371
#else
364
372
@@ -390,6 +398,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
390
398
}
391
399
392
400
image? . kf. imageFrameCount = source. frameCount
401
+ image? . kf. imageCreatingOptions = options
393
402
return image
394
403
#endif
395
404
}
0 commit comments