New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Gzip and Zip animation detection for File
and ContentProvider
animations in Compose
#2490
Comments
Compose doesn't use the header magic bytes like the view code path but in the next release, it will check for file extension. Would that be sufficient for your use case? |
Thank you for your quick response. For me, this isn't sufficient as my Gzip files have no extensions. Actually, this PR was what I'm talking about. Of course, migrating user data is possible, but it is more error prone than just supporting detecting the format using magic bytes or specifying the type explicitly. As a workaround, I can copy the |
Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.
Is your feature request related to a problem? Please describe.
You have done great work, adding support for G-zipped animations, but this feature depends on file extension for content providers and file sources. This is good for most cases, but in some cases when dealing with data without extensions from external sources or pre-existing data where migration is hard, an alternative method may be needed.
Describe the solution you'd like
One solution that won't introduce breaking changes would be using
isGzipCompressed
andisZipCompressed
which are already present in the codebase and used byRawRes
andAsset
. I think it is a better and foolproof detection method but may need early file probing.Describe alternatives you've considered
Another method could be adding optional argument to each
LottieCompositionSpec
(exceptJsonString
of course), which allows users to explicitly specify the animation type.Additional context
Not applicable
The text was updated successfully, but these errors were encountered: