• Home
Name Date Size #Lines LOC

..--

READMED12-May-20241.5 KiB5745

libwebp.goD12-May-20241.2 KiB4620

libwebp.pyD12-May-20248 KiB236181

libwebp.swigD12-May-202414 KiB439375

libwebp_gc.cD12-May-20241.4 KiB5328

libwebp_go_wrap.cD12-May-20246.4 KiB275195

libwebp_java_wrap.cD12-May-202452.4 KiB1,7661,490

libwebp_python_wrap.cD12-May-2024169.5 KiB5,6294,682

setup.pyD12-May-20241.2 KiB4132

README

1Building:
2=========
3
4JNI SWIG bindings:
5------------------
6 $ gcc -shared -fPIC -fno-strict-aliasing -O2 \
7       -I/path/to/your/jdk/includes \
8       libwebp_java_wrap.c \
9       -lwebp \
10       -o libwebp_jni.so
11
12-------------------------------------- BEGIN PSEUDO EXAMPLE
13import com.google.webp.libwebp;
14
15import java.lang.reflect.Method;
16
17public class libwebp_jni_example {
18  static {
19    System.loadLibrary("webp_jni");
20  }
21
22  /**
23   * usage: java -cp libwebp.jar:. libwebp_jni_example
24   */
25  public static void main(String argv[]) {
26    final int version = libwebp.WebPGetDecoderVersion();
27    System.out.println("libwebp version: " + Integer.toHexString(version));
28
29    System.out.println("libwebp methods:");
30    final Method[] libwebpMethods = libwebp.class.getDeclaredMethods();
31    for (int i = 0; i < libwebpMethods.length; i++) {
32      System.out.println(libwebpMethods[i]);
33    }
34  }
35}
36-------------------------------------- END PSEUDO EXAMPLE
37
38 $ javac -cp libwebp.jar libwebp_jni_example.java
39 $ java -Djava.library.path=. -cp libwebp.jar:. libwebp_jni_example
40
41Python SWIG bindings:
42---------------------
43 $ python setup.py build_ext
44 $ python setup.py install --prefix=pylocal
45
46-------------------------------------- BEGIN PSEUDO EXAMPLE
47import glob
48import sys
49sys.path.append(glob.glob('pylocal/lib/python*/site-packages')[0])
50
51from com.google.webp import libwebp
52print "libwebp decoder version: %x" % libwebp.WebPGetDecoderVersion()
53
54print "libwebp attributes:"
55for attr in dir(libwebp): print attr
56-------------------------------------- END PSEUDO EXAMPLE
57