oupson / jxlviewer

A Jpeg XL viewer and library for android.
MIT License
74 stars 3 forks source link

Request: split the repository into 2, so that one would be a dependency all can use to decode Jpeg XL easily, using Java/Kotlin #25

Open AndroidDeveloperLB opened 1 year ago

AndroidDeveloperLB commented 1 year ago

As the title says.

oupson commented 1 year ago

The app and the lib are already separated in the repository. When the lib will be more usable, I intend to publish it (on mavencentral if I figure it out how to publish on it).

AndroidDeveloperLB commented 1 year ago

@oupson So maybe it's possible to use Jitpack without any effort from your side, no?

AndroidDeveloperLB commented 1 year ago

@oupson It seems it should be possible: https://jitpack.io/#oupson/jxlviewer

However, for some reason there is an error with v0.3.0

oupson commented 1 year ago

@oupson It seems it should be possible: https://jitpack.io/#oupson/jxlviewer

However, for some reason there is an error with v0.3.0

Yeah I got the same problem with my other library, it is quite easy to fix : https://github.com/oupson/Kapng-Android/blob/master/jitpack.yml

AndroidDeveloperLB commented 1 year ago
jdk:
  - openjdk17

?

oupson commented 1 year ago

Jitpack is still using jdk 8 when AGP require jdk 17

AndroidDeveloperLB commented 1 year ago

Oh.... Are there more issues you know of?

oupson commented 1 year ago

Well sometimes build time out and you can't restart it, but otherwise nothing I'm aware of

oupson commented 1 year ago

This should work (untested):

dependencies {
            implementation 'com.github.oupson:jxlviewer:94fe98aaa4'
}
AndroidDeveloperLB commented 1 year ago

Thank you. Is this library better than others in some way? I can see this one for example: https://github.com/awxkee/jxl-coder

But I don't see a license there, and I don't see a way to downsample the image (to avoid using too much memory in case the image is huge) in the main page. Is it possible for jxl file format?

oupson commented 1 year ago

I wasn't aware there were other libraries for android, so I don't know which one is better. However jxl-coder seems to be able to encode jxl.

Down-sampling should to be possible with the jxl format.

AndroidDeveloperLB commented 1 year ago

I haven't checked the code here. Do you use down-sampling in the sample, or have some documentation about it? Maybe there is even some integration for Glide library?

oupson commented 1 year ago

No sorry I don't have any example. Down sampling could probably be down when decoding each frames. I'm not aware with any integration with the glide library.

I intend to invest more time to build a better library in the future, for the moment it is very simple.

AndroidDeveloperLB commented 1 year ago

Using BitmapFactory it's possible to get information about the image without actually saving the bitmap. And you can then know how much to down-sample it