question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebP with alpha on API 17

See original GitHub issue

I’m using compile 'com.facebook.fresco:webpsupport:0.10.0' to support transparent webp images on devices < 18 API (API 18 is when native support was added to framework).

But on some devices on API 17 (for example Huawei Ascend G700) I’m facing this weird bug: screenshot (for the reference, it should look like this). These webp images are from official google samples (WebP-lossy with alpha).

Is there some workaround about this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pavlo-zincommented, Jun 10, 2016

@massimocarli I reckon the problem is with decoding, as I’m getting the same bug with setWebpSupportEnabled(false).

0reactions
zjupurecommented, Jan 1, 2018

@massimocarli I have met this problem too. On some API <=17 devices, webp with alpha cannot be decoded normally. After some investigation, I found fresco use the wrong colorspace to decode webp in webp_bitmapfactory.cpp . The colorspace should be MODE_rgbA not MODE_RGBA, because in Android system, Bitmap pixel array are pre-multiplied by default. You can see in webp.cpp which account for decoding animated webp images, MODE_rgbA is using there, so webp frames with alpha can be displayed correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebP API Documentation - Google Developers
This section describes the API for the encoder and decoder that are included in the WebP library. This API description pertains to version...
Read more >
WebP image format | Can I use... Support tables for ... - CanIUse
Image format (based on the VP8 video format) that supports lossy and lossless compression, as well as animation and alpha transparency. WebP generally...
Read more >
Bitmap.CompressFormat.WEBP on Android API 19 alpha ...
I tried to pull the webp encoded file from the emulator API 19 and it hasn't the alpha channel anymore. – ryuujin. Sep...
Read more >
How To Create and Serve WebP Images to Speed Up Your ...
In this tutorial, you will use the command-line tool cwebp to convert images to WebP format, creating scripts that will watch and convert...
Read more >
Create WebP images - Android Developers
Lossy WebP images are supported in Android 4.0 (API level 14) and higher, and lossless and transparent WebP images are supported in Android ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found