Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoding to png results in a small black image. #248

Closed
TheHardew opened this issue Jun 29, 2021 · 3 comments
Closed

Decoding to png results in a small black image. #248

TheHardew opened this issue Jun 29, 2021 · 3 comments
Assignees
Labels
bug Something isn't working decoder Related to the libjxl decoder

Comments

@TheHardew
Copy link

Describe the bug
When decoding 003.jxl, which was losslessly transcoded from a jpg, the resulting png file is only 1953 B small and all black, even though djxl didn't throw any errors.
Decoding to the original jpg file is still possible, but only because --strip was not used, otherwise it would be impossible to decode this file at all.

To Reproduce
(unpack the attached zip file to get 003.jxl)

~ $ djxl 003.jxl 003.png
JPEG XL decoder v0.3.7 [AVX2]
Read 274618 compressed bytes.
Decoded to pixels.
752 x 1080, 14.64 MP/s [14.64, 14.64], 1 reps, 8 threads.
Allocations: 476 (max bytes in use: 3.297596E+07)

~ $ djxl 003.jxl 003.jpg
JPEG XL decoder v0.3.7 [AVX2]
Read 274618 compressed bytes.
Reconstructed to JPEG.
752 x 1080, 16.33 MP/s [16.33, 16.33], 6.64 MB/s [6.64, 6.64], 1 reps, 8 threads.
Allocations: 429 (max bytes in use: 3.297534E+07)

~ $ du -b 003.*
330011	003.jpg
274618	003.jxl
1953	003.png

Expected behavior
It should be possible to decode this file to png.

Environment

  • OS: Arch Linux
  • Compiler version: clang 12.0.0
  • CPU type: ryzen 2700x x86_64
  • cjxl/djxl version string: 8193d7b

Additional context
Compiled with https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=libjxl-git and

CFLAGS="-march=native -O3 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt -pthread -Wno-error -w"
CXXFLAGS="$CFLAGS"

003.jxl inside a zip file, otherwise github wouldn't accept it.
003.zip

@eustas eustas self-assigned this Jun 30, 2021
@eustas
Copy link
Contributor

eustas commented Jun 30, 2021

In gray mode 0-th channel is taken for output instead of 1-st.

@jonsneyers jonsneyers added bug Something isn't working decoder Related to the libjxl decoder labels Jul 1, 2021
@eustas
Copy link
Contributor

eustas commented Jul 5, 2021

It is encoder bug =( #250
Hopefully, no data is lost (as it is possible to decode to JPEG again).

@eustas
Copy link
Contributor

eustas commented Jul 5, 2021

Should be fixed. Though requires re-encoding of monochrome JPEGs with Adobe RGB ICC.

@eustas eustas closed this as completed Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working decoder Related to the libjxl decoder
Projects
None yet
Development

No branches or pull requests

3 participants