Image frame count #1645
Replies: 3 comments 2 replies
-
Thanks for it. #1647 has been merged and a new version (6.2) was released for this. |
Beta Was this translation helpful? Give feedback.
-
Hi @onevcat, Is there a way to store the frame count of an animated image when the image is created? I’m looking for a method to access or cache this information efficiently within the framework. Thanks for the help! Apne tv |
Beta Was this translation helpful? Give feedback.
-
Yes, it’s possible to store the animated image frame count when using |
Beta Was this translation helpful? Give feedback.
-
@onevcat Is it possible to store the animated image frame count when an animated image is created?
When
func animatedImage(data: Data, options: ImageCreatingOptions) -> KFCrossPlatformImage?
is called, theGIFAnimatedImage
has theimages
array populated, so it's easy to just store the frame count.If the no
preloadAll
oronlyFirstFrame
is used, then we can retrieve the same info from theimageSource
withCGImageSourceGetCount(imageSource)
.SDWebImage has this value stored in the image and it's retrieved by each decoder.
I can push a PR if necessary.
Beta Was this translation helpful? Give feedback.
All reactions