5

I am using Glide v3.7.0 to load image. I have no problem in loading .png format. But I dont even receive error response while loading .webp. If I tried to load the same url in browser it getting downloaded as file. And the file can be open via Chrome display the image correctly.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ganesh Kanna
  • 2,269
  • 1
  • 19
  • 29

2 Answers2

1

As currently Glide already provide support for .webp images. Please check below open issue on Glide Github repo.

https://github.com/bumptech/glide/issues/571

Faruk
  • 5,438
  • 3
  • 30
  • 46
AndiGeeky
  • 11,266
  • 6
  • 50
  • 66
0

I'm using GlideWebpDecoder

This library is compatible with Glide version 4.+

And the author is always trying to support with newest version of Glide

This is the code snippet :

Transformation<Bitmap> circleCrop = new CircleCrop();
GlideApp.with(mContext)
    .load(url)
    .optionalTransform(circleCrop)
    .optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(circleCrop))
    .into(imageView);
Faruk
  • 5,438
  • 3
  • 30
  • 46
  • Hey I stumbled upon this answer and I had a look at the sample app for the library. My use case is such that I do not have `circleCrop` or other transformations right now. How can I load `webp` images from server? For case like mine, the sample app does nothing (see line 103 of `ImageAdapter.java`), does it mean glide supports `webp` by default? It does not seem so for me. Can you help me in anyway? – ravi Jun 23 '20 at 11:18
  • Where is GlideApp Class or Object?? I can't find it. – c-an Feb 09 '21 at 09:05
  • @c-an you can see in https://github.com/bumptech/glide/issues/3170 for more explanation about `GlideApp` – Faruk Feb 09 '21 at 14:25