update: how to compile native library and new win dll

This commit is contained in:
ninthakeey 2019-09-06 23:46:54 +08:00
parent 95716b340f
commit f835b73a81
8 changed files with 64 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

View File

@ -36,4 +36,67 @@ if you use maven, you can put it `${project.basedir}/libs`, and edit config file
</dependency> </dependency>
``` ```
The usage of api, you can see example cases in `src/main/java/example`. The usage of api, you can see example cases in `src/main/java/example`.
## Compiling the native library
download source code of [webp project of Luciad](https://bitbucket.org/luciad/webp-imageio) , and unzip it.
```shell
wget https://bitbucket.org/luciad/webp-imageio/get/873c5677244b.zip -O luciad-webp-imageio-873c5677244b.zip
unzip luciad-webp-imageio-873c5677244b.zip
```
download source code of [google webp project](https://chromium.googlesource.com/webm/libwebp)
```shell
git clone https://chromium.googlesource.com/webm/libwebp
```
or use the [mirror repo](https://github.com/webmproject/libwebp)
copy folder libwebp into folder luciad-webp-imageio-873c5677244b, and create a directory called `build` in the folder luciad-webp-imageio-873c5677244b
folder tree like this:
```
luciad-webp-imageio-873c5677244b/
|_ build/ <-- just created
|_ gradle/
|_ src/
|_ libwebp/ <-- copy from project libwebp
|_ .hgignore
|....
|.... (other files)
```
Install CMake 2.8 or newer. CMake can be downloaded from [www.cmake.org](http://www.cmake.org/) or installed using your systems package manager. if you use Win10 and VS 2019, it need CMake 3.14 or newer.
Open a terminal and navigate to the newly created 'build' directory.
```
cd ./build
cmake ..
cmake --build .
```
The compiled library can be found under the directory `build/src/main/c`
if you need specific the generator-name, please add `-G <generator-name>` parameter for cmake, like this
```shell
// cmake ..
cmake .. -G "Visual Studio 16 2019"
```
## Compiling the Java library
- Run `./gradlew build -x test` in the root of the project
- The compiled Java library can be found under the `build` directory

BIN
test_pic/test_.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB