VandersonQk / KuroReaderReleases

Apk releases from Kuro Reader and Kuro Reader Pro
https://kurotoshiro.dev/
47 stars 0 forks source link

Half support of AVIF file format #15

Closed 5h4k3 closed 3 weeks ago

5h4k3 commented 2 months ago

Hello,

I wished since a long time to make KuroReader my daily reader (and buy it) but since my comics are mainly in AVIF image format it was not possible. Until I discover something today.

I started to test your last version, to see all changes and stuff and I was surprised to see all the thumbnails of my comics in my library (the covers are also in AVIF too of course) compared to the last one time I tried it! 

But it seems it can only create these thumbnails. It's still not possible to open a comic book (a “Try Again” pop-up appears). Weird...

At least, in default /normal mode... I tried using "Enable classic reader" (for blurry images, android 6.0) and it worked! I can now read all my AVIF comics and have the joy of using the comicinfo.xml metadata...

However, while I don't mind having to use KuroReader with this option enabled on my Android 13 tablet, I still find it odd that it can create AVIF thumbnails but not open books......

I'm not versed at coding but I thought maybe, hopefully, it wouldn't add much work to you if the compatibility (libraries or otherwise) is already almost there, hence my report.

Anyway, thanks you for this incredibly application and I wish you to have a nice day.

VandersonQk commented 1 month ago

TLDR; The new version supports AVIF, but with some limitations. Partial support on Android 13 and almost full support on Android 14

The error

The error occurs because the Android system is quite fragmented and the image decoder used in the reader does not support AVIF.

Kuro Reader uses 2 different methods to decode the image:

Support

I use a workaround to decode GIF images in the default reader, so I used the same approach to decode the AVIF files. It's a simple real-time conversion to lossless JPEG, but it allows the application to read the files.

But there are some limitations:

Why convert to JPEG instead of PNG?

Speed. The encoding time for JPEG is a fraction of the time it takes to encode a PNG, so it's better for real-time conversion.

5h4k3 commented 1 month ago

I take note of the limitations, thanks for the explanations. But, so far, so good, it works wonderfully on my Android (13) and every options are functional, like the two double page options (which didn't work before). Thank you very much for you consideration.