lifthrasiir / j40

J40: Independent, self-contained JPEG XL decoder
Other
231 stars 3 forks source link

`Error: Decoding failed (rnge) during j40_next_frame` #13

Open nigeltao opened 1 year ago

nigeltao commented 1 year ago

I built cjxl from the official https://github.com/libjxl/libjxl repo. I then made a bricks-color.jxl file (attached, with a fake .png file extension to satisfy the GitHub upload UI).

$ build/tools/cjxl bricks-color.png bricks-color.jxl
JPEG XL encoder v0.8.0 506714ed [AVX2,SSE4,SSSE3,Unknown]
Read 160x120 image, 33928 bytes, 18.7 MP/s
Encoding [VarDCT, d1.000, effort: 7], 
Compressed to 7287 bytes (3.036 bpp).
160 x 120, 0.76 MP/s [0.76, 0.76], 1 reps, 8 threads.

Trying to decode that with j40 hits an error:

$ ./dj40 bricks-color.jxl out.png
Error: Decoding failed (rnge) during j40_next_frame

antermin commented 1 year ago

According to the README:

  • Most images encoded with [cjxl][libjxl] containing...
    • No animations or previews
    • No image features (--dots and --patches), which implies:
      • Efforts (-e) up to 6
      • For lossy compression, target distance (-d) less than 3.0

However, by default cjxl uses -e 7, as seen in the output:

Encoding [VarDCT, d1.000, effort: 7],

Therefore the JXL file cannot be decoded at the moment.