Cannot re-encode jpg
Describe the bug cjxl fails to create readable jxl file.
To Reproduce Steps to reproduce the behavior:
$ cjxl -q 70 -j 0 IMG_20160422_102122.jpg i2.jxl
JPEG XL encoder v0.7.0 f95da131 [SSE4,SSSE3,Unknown]
Read 2560x1536 image, 1574521 bytes, 184.2 MP/s
Encoding [Container | VarDCT, d2.800, effort: 7 | 602-byte Exif],
Compressed to 477184 bytes including container (0.971 bpp).
2560 x 1536, 2.38 MP/s [2.38, 2.38], 1 reps, 4 threads.
$ jxlinfo i2.jxl
JPEG XL file format container (ISO/IEC 18181-2)
JPEG XL image, 2560x1536, lossy, 8-bit RGB
Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Perceptual
Unexpected EOF
$ cjxl -V
cjxl v0.7.0 f95da131 [SSE4,SSSE3,Unknown]
Copyright (c) the JPEG XL Project
Environment
- OS: Arch linux with community/libjxl 0.7.0-3
- CPU type: x86_64
- cjxl/djxl version string: cjxl v0.7.0 f95da131 [SSE4,SSSE3,Unknown]
Thanks for the bug report! A few remarks:
- your file i2.jxl (i.e. the one named i2.jxl.jpg) can be decoded fine with e.g.
djxl github-cjxl-bug-report/i2.jxl.jpg test.png, at least for me, could you confirm that @gdmn? - I get the same result "Unexpedted EOF" when I take the jxlinfo from current HEAD as well as the one from f95da13.
- I can't repro the issue neither on current HEAD nor on f95da13:
~/libjxl ((v0.7.0))> ./build/tools/cjxl -q 70 -j 0 github-cjxl-bug-report/IMG_20160422_102122.jpg i2.jxl && ./build/tools/jxlinfo i2.jxl
JPEG XL encoder v0.7.0 f95da131 [AVX3,AVX2,SSE4,SSSE3,Unknown]
Read 2560x1536 image, 1574521 bytes, 348.8 MP/s
Encoding [Container | VarDCT, d2.800, effort: 7 | 602-byte Exif],
Compressed to 477187 bytes including container (0.971 bpp).
2560 x 1536, 1.87 MP/s [1.87, 1.87], 1 reps, 96 threads.
JPEG XL file format container (ISO/IEC 18181-2)
JPEG XL image, 2560x1536, lossy, 8-bit RGB
Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Perceptual
seems to work fine. Could you check if you can reproduce the problem on the current HEAD, @gdmn?
Something weird seems to be going, since it is failing for you but not for me.
I confirm that djxl v0.7.0 f95da131 can decode i2.jxl.jpg correctly.
Also tried current main branch (3d960dd8) and the bug does not occur anymore.
Then I tried to manually build and test f95da131 version: git reset --hard f95da131 && git clean -fdx && git submodule update --init --recursive --depth 1 --recommend-shallow and still Unexpected EOF is returned.
Then I build f95da131 on another machine (ubuntu) and to my surprise everything works there.
So my guess is that some library is in different version on Arch which is the root cause of the issue.
Could it also perhaps be because of different instruction sets?
Is this still happening?