public class WebPBackport
extends java.lang.Object
| Constructor and Description |
|---|
WebPBackport() |
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
decode(byte[] encoded)
Decodes any image supported by the system or the WebP library.
|
static void |
forceLoadLibrary() |
static android.graphics.Rect |
getSize(byte[] encoded)
Get size of an encoded WebP image.
|
static boolean |
isLibraryUsed()
Is the native library used to decode WebP images?
|
static boolean |
isWebPSupported()
Returns whether WebP images can be decoded.
|
public static void forceLoadLibrary()
public static android.graphics.Bitmap decode(byte[] encoded)
Note that this method not only supports WebP, but supports PNG, JPG etc. as well. But if WebP data is detected this will do some more magic. :-)
encoded - The encoded image data (e.g. from a stream, resource, etc.).null if it could not be decoded successfully.public static boolean isWebPSupported()
true if WebP is supported.public static boolean isLibraryUsed()
true if the native library is used.public static android.graphics.Rect getSize(byte[] encoded)
encoded - The WebP data.null if something went wrong.