Facebook patches for FLAnimatedImage#86
Conversation
A number of refactors to make FLAnimatedImage more supporting of new image formats. First, split the caching logic into its own object, FLAnimatedImageFrameCache, so it can be shared between types. Next, introduce an abstraction over the imate data, FLAnimatedImageData. Finally, update the GIF support to be implemented as a plugin for the core FLAnimatedImage library.
By default, WebP support is disabled. To enable, request the WebP subspec. For local builds of FLAnimatedImage, you'll need a copy of libwebp in the libwebp/ directory in the root of the repository.
|
Wow! |
|
😉 |
|
Hey there @grp and @benhiller, I'm working on reviewing this and I've run into a snag, looking for some help. I've downloaded libwebp from here and added it to the root level of the project, but I'm getting build errors when trying to run the sample project. Also, I'm seeing a set of warnings about libwebp being built for iOS 9.1 but the FLAnimatedImage sample project being build for iOS 7, which we still support. It looks like this patch might refer to an older version of libwebp, can you guys help? Thanks! |
|
I would love to merge this, but it and master have diverged quite a bit and it is effectively a rewrite of much of the core of FLAnimatedImage. I'm going to close it, but I wanted to thank you for your contributions. I'll direct people in need of WebP support to your fork. |
|
You saved me! |
|
@PhilCai1993 now you can use BDImageView for animate webp 😀 |
|
جميل |


A few months ago, I saw a tweet that Ryan Olson noticed that FLAnimatedImage was used in the Facebook apps. I've been working off-and-on since then to clean up the refactor and WebP support we'd done to contribute upstream, and it's finally ready now.
Since the version used in the Facebook app was branched almost a year ago, it was a little tricky to rebase onto master. I was only able to make it reasonable by rewriting the history, so this pull request has just two (relatively large) patches: one to make the image format support more pluggable, and one to add WebP support.
For both the patches, I decided to go with a multiple-target approach using subspec's rather than require pulling in libwebp for all uses of FLAnimatedImage. It's a little more complex, but it's closer to how we have it set up internally at Facebook and is more flexible for users.
Let me know if you have any questions. Most of the changes here were by @benhiller, I just cleaned them up for upstreaming, but we should both be able to answer questions on the approach or the code.
🚀