qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

WebP JNI Wrapper for Advanced API #238

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have seen a Swig file for the simple API, but there isn't a JNI wrapper for 
the Advanced API. It would be very helpful to include this especially for folks 
who want to integrate the library into Android.

As you know, WebP is supported in Android starting from version 4.0; however, 
transparency is not supported until after version 4.2.1. This means that about 
34% of Android devices can not decode WebP with transparency.  Also, with the 
simple API, we can't perform scaled decoding, which is a must on Android. This 
makes the need for the Advanced APIs support on Android even more.

Are there any plans to implement this, and is there a timeline that you can 
share? We're planning on integrating webp into our app and would like to take 
advantage of the Advanced API.

Thanks!

Original issue reported on code.google.com by Sajjad.J...@gmail.com on 12 Jan 2015 at 7:54

GoogleCodeExporter commented 8 years ago
Hi,

There's no work being on this currently. Would the imageio plugin [1] work?

[1] https://bitbucket.org/luciad/webp-imageio

Original comment by jz...@google.com on 13 Jan 2015 at 2:51

GoogleCodeExporter commented 8 years ago
"WebP decoding supports an advanced API to provide ability to have on-the-fly 
cropping and rescaling, something of great usefulness on memory-constrained 
environments like mobile phones." -- WebP API Documentation

As Google is targeting this usage scenario, it is only fair to expect that 
Google should provide access to its Advanced API in what is ostensibly the 
language binding of WebP for Google-powered mobile phones. The omission of such 
a binding is somewhat embarrassing seen in this light.

Original comment by thorh...@gmail.com on 13 Jan 2015 at 3:10

GoogleCodeExporter commented 8 years ago
ImageIO plugin author here. That won't work on Android since it's tied to 
javax.imageio which isn't available on Android. If there's sufficient interest, 
I can make the core WebP interface part JavaSE/Android independent so it can be 
used on both platforms.

Original comment by pepijn.v...@luciad.com on 13 Jan 2015 at 8:10

GoogleCodeExporter commented 8 years ago
@pepijn.v...@luciad.com, we're definitely interested, and I've seen others who 
are interested in back porting webp to earlier versions of Android. For 
example, https://github.com/mreichelt/webp-android-backport-library is an 
attempt to back port but that only uses the Simple API, which isn't ideal. 
Having an independent interface will be great!

I also wanted to mention that, although we're not experienced in this area, we 
can help out with development of the interface. We'd need some guidance on how 
to approach it and probably a pair of eyes to review it. Let me know if this 
works.

Thanks!

Original comment by Sajjad.J...@gmail.com on 13 Jan 2015 at 7:00

GoogleCodeExporter commented 8 years ago
https://bitbucket.org/luciad/webp-imageio/commits/fa68e79f784b7e1bc6b957cb2ed8d4
86d31c08d7
splits off the Java SE dependent parts and adds a really basic Android 
compatible wrapper. All the libwebp encoder/decoder options are exposed via the 
WebPEncoder/DecoderOptions classes. These aren't documented yet, but the naming 
and semantics are identical to what you can find in the libwep's webp.h header.

I haven't had time to create an Android.mk script for the native library yet, 
nor for the jar file. Contributions always welcome of course.

The Android code also hasn't been optimized yet at all (there's a lot of 
needless memcpy'ing going on) and I haven't had a chance to test this yet 
either. Really a work-in-progress in other words intended to solicit feedback.

Original comment by pepijn.v...@luciad.com on 14 Jan 2015 at 8:40