Re: gif2webp in Java

53 views
Skip to first unread message

Urvang Joshi

unread,
Sep 21, 2016, 5:51:07 PM9/21/16
to Ahmad Al-Mughrabi, webp-d...@webmproject.org
+WebP Discussion 
Hi Ahmad,
Unfortunately, libwebp.jar currently does not have JNI wrappers for mux.h APIs, which are required for creating an animated WebP.
One would have to add wrappers for mux APIs in this SWIG wrapper https://chromium.googlesource.com/webm/libwebp/+/master/swig/libwebp_java_wrap.c for that.

-Urvang

On Wed, Sep 21, 2016 at 1:45 PM Ahmad Al-Mughrabi <amug...@atypon.com> wrote:
Hi Urvang,

I would like to ask if there is a way to use gif2webp via JNI. I tried use the libwebp.jar that provided in webp api, but unfortunately with no luck to encode animated gif images, could you please guide me to reach this goal?

--

Sincerely,
Ahmad Al-Mughrabi.

Statement of Confidentiality 

The contents of this e-mail message and any attachments are confidential and are intended solely for addressee. The information may also be legally privileged. This transmission is sent in trust, for the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or phone and delete this message and its attachments, if any.
--
Thanks & Regards,
Urvang

Urvang Joshi

unread,
Sep 22, 2016, 11:47:37 AM9/22/16
to Ahmad Al-Mughrabi, jz...@google.com, webp-d...@webmproject.org
+jz...@google.com +WebP Discussion 
James wrote the JNI wrappers, so he'll be able to point you in the right direction.

On Thu, Sep 22, 2016 at 1:54 AM Ahmad Al-Mughrabi <amug...@atypon.com> wrote:
Thanks Urvang, I took a quick look to libwebp_java_wrap.c, and this file is automatically generated from swig tool. It seems libwebp.swig need to be modified and regenerating the JNI wrappers(compiled classes) to java/com/google/webp by using swig tool, then packaging the generated compile classes in new libwebp.jar. 

I see there are useful comments inside libwebp.swig about regenerating the JNI wrappers by using swig tool, but I'm not sure what should I modified inside libwebp.swig. Out of curiosity, Are you planning to provide Mux api in next release for webp? If not, could you please help me by providing a sample of code about the changes on libwebp.swig?

Many thanks, 
- Ahmad.  

James Zern

unread,
Sep 22, 2016, 10:17:31 PM9/22/16
to WebP Discussion
Hi,


On Thursday, September 22, 2016 at 8:47:37 AM UTC-7, Urvang Joshi wrote:
+jz...@google.com +WebP Discussion 
James wrote the JNI wrappers, so he'll be able to point you in the right direction.

On Thu, Sep 22, 2016 at 1:54 AM Ahmad Al-Mughrabi <amug...@atypon.com> wrote:
Thanks Urvang, I took a quick look to libwebp_java_wrap.c, and this file is automatically generated from swig tool. It seems libwebp.swig need to be modified and regenerating the JNI wrappers(compiled classes) to java/com/google/webp by using swig tool, then packaging the generated compile classes in new libwebp.jar. 

I see there are useful comments inside libwebp.swig about regenerating the JNI wrappers by using swig tool, but I'm not sure what should I modified inside libwebp.swig.
Out of curiosity, Are you planning to provide Mux api in next release for webp?

There's no one actively working on that, but we'd be happy to review patches that enabled the mux api.
 
If not, could you please help me by providing a sample of code about the changes on libwebp.swig?


swig documentation can be found on their site [1]. The mux api function calls would need to be added to the .swig file similar to what is done for the simple libwebp api. Another alternative, if you're not comfortable with swig, would be to add custom jni code to suit your use case.

Reply all
Reply to author
Forward
0 new messages