WebP for Android [closed]

Use libwebp with NDK. libwebp-0.1.3 already comes with Android.mk file (outdated and with syntax errors, but still). It also got generated JNI bindings in /swig/ directory. Here’s how I got it working: Download NDK, put it in system PATH. download libwebp-0.1.3.tar.gz, place it in your_project_dir/jni Replace Android.mk with the one below. Create jni/src/libwebp_java_wrap.c with content … Read more

Detecting WebP support

This is my solution – is taking around 6ms and I’m considering WebP is only a feature for a modern browser. Uses a different approach using canvas.toDataUrl() function instead of image as the way to detect the feature: function support_format_webp() { var elem = document.createElement(‘canvas’); if (!!(elem.getContext && elem.getContext(‘2d’))) { // was able or not … Read more