Skip to content
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

When using RequestOptions, webp animations cannot be displayed. #5441

Open
whitestarlau opened this issue Aug 23, 2024 · 2 comments
Open

When using RequestOptions, webp animations cannot be displayed. #5441

whitestarlau opened this issue Aug 23, 2024 · 2 comments

Comments

@whitestarlau
Copy link

Glide Version: 4.16.0

Device/Android Version: Xiaomi 14,Anroid version 14

Use Detail:When RequestOptions is not set, it works fine. But after setting it, it doesn't work.

Glide load line / GlideModule (if any) / list Adapter code (if any):

        val options = RequestOptions().fitCenter()

        Glide.with(this)
            .load("https://oss-console-img-demo-cn-hangzhou-3az.oss-cn-hangzhou.aliyuncs.com/example.gif?x-oss-process=image/resize,w_200/format,webp")
            .apply(options)
            .placeholder(R.color.black)
            .into(binding.image)

Stack trace / LogCat:

2024-08-23 10:57:19.341 13550-13550 Glide                   com.example.notificationtest         I  Root cause (1 of 1)
                                                                                                    java.lang.IllegalArgumentException: Unable to convert android.graphics.drawable.AnimatedImageDrawable@b990125 to a Bitmap
                                                                                                    	at com.bumptech.glide.load.resource.bitmap.DrawableTransformation.transform(DrawableTransformation.java:55)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.onResourceDecoded(DecodeJob.java:578)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob$DecodeCallback.onResourceDecoded(DecodeJob.java:642)
                                                                                                    	at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:60)
                                                                                                    	at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
                                                                                                    	at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:539)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:503)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:489)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:434)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:399)
                                                                                                    	at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:100)
                                                                                                    	at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:62)
                                                                                                    	at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:77)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:277)
                                                                                                    	at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:424)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run(GlideExecutor.java:383)
@whitestarlau
Copy link
Author

I see the implementation of GifDrawableTransformation in the code, but the webp animation does not seem to have a corresponding implementation?

@spocky
Copy link

spocky commented Sep 9, 2024

You can replace with optionalFitCenter to make it work.
cf: #4943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants