sejda-pdf / webp-imageio

Java ImageIO WebP support
Apache License 2.0
212 stars 80 forks source link

Support multiple architectures #6

Open gotson opened 4 years ago

gotson commented 4 years ago

This PR would address #5

I added some Travis tests for multiple versions of MacOS, as well as Linux on ARM64. Other architectures like Linux 32bits or ARM 32bits are not available. This could be worked out with docker maybe.

Changed the JNI loader to use the same one as in https://github.com/xerial/sqlite-jdbc. It supports more CPU architectures than the current loader, and also handles versioning of the temp file, and cleanup on JVM exit.

Reworked the CMake project to remove the dependency on JNI, which would require to have Java on the build machines, while all that is really needed are the JNI headers.

The cross-compilation of libwebp can be done using https://github.com/dockcross/dockcross for most of the architectures, except for Mac which uses https://github.com/multiarch/crossbuild. I added a bash script to compile all the architectures, which will copy everything in the resources folder after building.

ediweissmann commented 4 years ago

Thank you! I'll try to have a look at this as soon as possible.

gotson commented 4 years ago

There might be a few things to leave out, I had to change the maven setup to make it work on my machine. I don't have a toolchain installed so I commented that out.

You can try to build the images on your machine by using the compile-all.sh. Hopefully it works on your machine too!

gotson commented 4 years ago

Hi @ediweissmann, did you had time to look at this PR by any chance ?

My application has some performance issues with the current plain java webp reader, which would be solved by using your library, but it requires support for more architectures than currently supported.

Let me know if you need some help understanding what i did, or how i did it, or if you require some changes on the way it's integrated.

chelming commented 4 years ago

@ediweissmann @pepijnve any updates on getting this merged?

lambdaupb commented 3 years ago

@gotson

My application has some performance issues with the current plain java webp reader

Is that plain java library open source? I have a edge case use-case and would prefer a plain java lib.

Thanks in advance!

gotson commented 3 years ago

@gotson

My application has some performance issues with the current plain java webp reader

Is that plain java library open source? I have a edge case use-case and would prefer a plain java lib.

Thanks in advance!

A bit off-topic, but yes, i'm using this: https://sourceforge.net/projects/javavp8decoder/files/imageIO%20Plugin/

Ali-RS commented 3 years ago

Hi @gotson

If you have the jar and prebuilt natives for this PR, would you mind uploading them here?

Regards

gotson commented 3 years ago

Hi @gotson

If you have the jar and prebuilt natives for this PR, would you mind uploading them here?

Regards

They are available in Maven Central: https://search.maven.org/artifact/com.github.gotson/webp-imageio/0.2.1/jar

Ali-RS commented 3 years ago

Thanks :)

Ali-RS commented 2 years ago

Hi @gotson, any chance for adding Mac ARM64 architecture?

gotson commented 2 years ago

Hi @gotson, any chance for adding Mac ARM64 architecture?

Unlikely. There's no support using Docker to cross compile for that, so the only way to do so is by using a physical Mac, which I don't own.

Ali-RS commented 2 years ago

I see, thank you.

Apprisco commented 2 years ago

hi @gotson, thank you so much for your PR and the maven central repository, I was pulling my hair out trying to compile this library for arm64.

tuta23 commented 2 years ago

Does this PR solve the ARM64 issue?

gotson commented 2 years ago

Does this PR solve the ARM64 issue?

For linux only

viakunin commented 2 years ago

I've opened the PR with the missing MacOS AArch64 binary here - https://github.com/gotson/webp-imageio/pull/1