issue_owner_repo listlengths 2 2 | issue_body stringlengths 0 262k ⌀ | issue_title stringlengths 1 1.02k | issue_comments_url stringlengths 53 116 | issue_comments_count int64 0 2.49k | issue_created_at stringdate 1999-03-17 02:06:42 2025-06-23 11:41:49 | issue_updated_at stringdate 2000-02-10 06:43:57 2025-06-23 11:43:00 | issue_html_url stringlengths 34 97 | issue_github_id int64 132 3.17B | issue_number int64 1 215k |
|---|---|---|---|---|---|---|---|---|---|
[
"libjxl",
"libjxl"
] | **Describe the bug**
from current main branch, compilation fails with a log:
```
[100%] Generating C API documentation
/home/anon/Downloads/libjxl-git/src/libjxl/lib/include/jxl/encode.h:813: error: documented empty return type of JxlEncoderInitExtraChannelInfo (warning treated as error, aborting now)
```
**To Reproduce**
Steps to reproduce the behavior:
on archlinux makepkg https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=libjxl-git&id=b63b3d77c745217efa1f3287840bbb4c879f058d but with `-DJPEGXL_FORCE_SYSTEM_HWY:BOOL='true'` taken out.
**Expected behavior**
stuff builds
**Environment**
- OS: archlinux
- Compiler version: doxygen 1.9.3
- CPU type: x86_64
- cjxl/djxl version string: N/A
**Additional context**
in `CMakeLists.txt` there's `set(DOXYGEN_WARN_AS_ERROR "YES")` set which IMO should be false or value of `JPEGXL_WARNINGS_AS_ERRORS` | .../lib/include/jxl/encode.h:813: error: documented empty return type of JxlEncoderInitExtraChannelInfo (warning treated as error, aborting now) | https://api.github.com/repos/libjxl/libjxl/issues/1080/comments | 0 | 2022-01-09T22:08:41Z | 2022-01-13T19:44:29Z | https://github.com/libjxl/libjxl/issues/1080 | 1,097,315,131 | 1,080 |
[
"libjxl",
"libjxl"
] | libjxl's current API reports how much was consumed and how much was not consumed by libjxl, but it will consume past the end of a codestream and simply do nothing with this information. For raw JPEG XL Codestream input into libjxl's decoder, it should refuse to consume input after the end of the codestream. For libjxl's container input, it should refuse to consume input after the last box, and if a `jxlc` or `jxlp` box appears with size `0`, it should refuse to consume input after the codestream ends.
The motivation behind this is that it will allow JPEG XL files to be concatenated together and the decoder won't consume the entire stream, treating every subsequent file as end-of-stream junk. | libjxl should not consume input beyond the end of a JPEG XL file | https://api.github.com/repos/libjxl/libjxl/issues/1079/comments | 2 | 2022-01-08T16:47:04Z | 2024-03-04T10:12:36Z | https://github.com/libjxl/libjxl/issues/1079 | 1,096,978,871 | 1,079 |
[
"libjxl",
"libjxl"
] | Currently when spline is quantized, it uses Y channel before calculates it. Preparing PR to fix that.
However, there are other problems, namely:
* [spec] in C.4 there is a reference to non-existing `C.4.6.4`
* [spec] in C.4 `X` channel should be decorrelated similarly to `B` channel | Spline quantization fixups | https://api.github.com/repos/libjxl/libjxl/issues/1072/comments | 1 | 2022-01-03T15:03:08Z | 2022-03-11T18:50:46Z | https://github.com/libjxl/libjxl/issues/1072 | 1,092,583,160 | 1,072 |
[
"libjxl",
"libjxl"
] | null | square_root template seems to be an over-expressive definition of 1.41 constant | https://api.github.com/repos/libjxl/libjxl/issues/1070/comments | 1 | 2022-01-03T12:18:30Z | 2022-01-27T22:52:56Z | https://github.com/libjxl/libjxl/issues/1070 | 1,092,464,000 | 1,070 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
I tested the addition in pull request https://github.com/libjxl/libjxl/pull/1058.
There seems to be some trouble with blending some(?) non-full frames with transparency. Instead of showing the previous background it shows a fully transparent background for some "subframes" in some images, creating transparent rectangles.
I created an animation with just three frames to show this effect and attached it to this issue.
**To Reproduce**
- Encode the input.png with cjxl : cjxl -d 0.0 -e 7 in.png out.jxl
- decode out.jxl back to animated png: djxl out.jxl out.png
- compare the animations in an imageviewer or browser (I compared with firefox) and observe the difference.
(note: I believe the wrong transparency happens during encoding, so the out.jxl file is already "broken". Not 100% sure though...)
**Expected behavior**
Animation before and after conversion should look the same, or cjxl should throw an error if this is not possible.
**Environment**
- OS: Ubuntu 21.10
- Compiler version: gcc version 11.2.0
- CPU type: x86_64
- cjxl/djxl version string: v0.7.0 844b1ec [AVX2,SSE4,SSSE3,Scalar]
Was also able to reproduce on Windows 10 with a build of cjxl from https://artifacts.lucaversari.it/libjxl/libjxl/latest/
**(Correct) Input png**

**(Broken) Animated jxl decoded to apng**
 | Some animated pngs with non-full frames with transparency visually differ from source after transcoding with cjxl | https://api.github.com/repos/libjxl/libjxl/issues/1065/comments | 0 | 2021-12-30T21:07:01Z | 2021-12-31T09:42:56Z | https://github.com/libjxl/libjxl/issues/1065 | 1,091,304,848 | 1,065 |
[
"libjxl",
"libjxl"
] | normally for multilib builds, tools are disabled (you may need lib32/libjxl.so but probably not bin32/cjxl). according to fb8369735ac9c55fcbd19c312c41d4f288334f78, gflags will be used for cjxl (and i guess maybe djxl too?) so it shouldn't be required for non-tools builds. | require gflags only if tools are enabled | https://api.github.com/repos/libjxl/libjxl/issues/1062/comments | 3 | 2021-12-30T15:43:49Z | 2022-01-18T21:18:22Z | https://github.com/libjxl/libjxl/issues/1062 | 1,091,177,176 | 1,062 |
[
"libjxl",
"libjxl"
] | Some `kDeltaPalette` entries are UB to use when `bit_depth==32`, namely:
```{128, 128, 128}, {144, 144, 144}, {0, 128, 128}, {-128, 0, 0}, {128, 128, 0}, {0, 0, -128}```
What decoder should do, when it is asked about such entries? | Delta palette for bit_depth=32 | https://api.github.com/repos/libjxl/libjxl/issues/1057/comments | 6 | 2021-12-28T16:16:10Z | 2022-03-31T14:59:34Z | https://github.com/libjxl/libjxl/issues/1057 | 1,089,997,556 | 1,057 |
[
"libjxl",
"libjxl"
] | compiling git, i get:
```
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/render_pipeline/render_pipeline_stage.h:124:24: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long long unsigned int'} and 'int' [-Wsign-compare]
124 | JXL_DASSERT(offset <= 1 << settings_.shift_y);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
```
a cast will remove it
| warning signed/unsigned | https://api.github.com/repos/libjxl/libjxl/issues/1050/comments | 1 | 2021-12-25T15:19:04Z | 2022-03-11T18:52:27Z | https://github.com/libjxl/libjxl/issues/1050 | 1,088,616,754 | 1,050 |
[
"libjxl",
"libjxl"
] | We found a crash with heap-buffer-overflow when fuzzing djxl_fuzzer target. The crash can only be reproduced after 7c5dfcd35fc6a91ae9d776bda7e23ecfaa8bfb38, so I suspect it is related to coalescing mode. The release versions don't seem to be affected.
**To Reproduce**
It is fuzzed with a modified oss-fuzz, therefore it can be reproduced with the oss-fuzz setup.
Steps to reproduce the behavior:
1. Follow [https://github.com/libjxl/libjxl/blob/main/doc/fuzzing.md](https://github.com/libjxl/libjxl/blob/main/doc/fuzzing.md) to setup the environment.
2. Build binaries with ASAN `BUILD_DIR=build-fuzzasan ./ci.sh ossfuzz_asan`.
3. Run `build-fuzzasan/tools/djxl_fuzzer ./poc1` to reproduce.
`poc1` can be downloaded here: [poc1](https://drive.google.com/file/d/1k_YsaFfTI3P7jrfNnoxJzkshGLsGWZ8P/view?usp=sharing)
**ASAN log**
```
=================================================================
==1239039==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61a000000504 at pc 0x55ff987f4bca bp 0x7fb9149f66d0 sp 0x7fb9149f66c8
WRITE of size 1 at 0x61a000000504 thread T2
#0 0x55ff987f4bc9 in StoreRGBA<hwy::N_SCALAR::Simd<unsigned char, 1>, hwy::N_SCALAR::Vec1<unsigned char> > /src/libjxl/lib/jxl/dec_reconstruct.cc:199:10
#1 0x55ff987f4bc9 in jxl::N_SCALAR::FloatToRGBA8(jxl::Image3<float> const&, jxl::Rect const&, bool, jxl::Plane<float> const*, jxl::Rect const&, jxl::Rect const&, unsigned char*, unsigned long) /src/libjxl/lib/jxl/dec_reconstruct.cc:294:9
#2 0x55ff987fff38 in jxl::FinalizeImageRect(jxl::Image3<float>*, jxl::Rect const&, std::__1::vector<std::__1::pair<jxl::Plane<float>*, jxl::Rect>, std::__1::allocator<std::__1::pair<jxl::Plane<float>*, jxl::Rect> > > const&, jxl::PassesDecoderState*, unsigned long, jxl::ImageBundle*, jxl::Rect const&) /src/libjxl/lib/jxl/dec_reconstruct.cc:1104:9
#3 0x55ff9880fa9b in operator() /src/libjxl/lib/jxl/dec_reconstruct.cc:1244:12
#4 0x55ff9880fa9b in jxl::ThreadPool::RunCallState<jxl::FinalizeFrameDecoding(jxl::ImageBundle*, jxl::PassesDecoderState*, jxl::ThreadPool*, bool, bool, bool)::$_1, jxl::FinalizeFrameDecoding(jxl::ImageBundle*, jxl::PassesDecoderState*, jxl::ThreadPool*, bool, bool, bool)::$_2>::CallDataFunc(void*, unsigned int, unsigned long) /src/libjxl/lib/jxl/base/data_parallel.h:82:14
#5 0x55ff98cc0c64 in RunRange /src/libjxl/lib/threads/thread_parallel_runner_internal.cc:139:7
#6 0x55ff98cc0c64 in jpegxl::ThreadParallelRunner::ThreadFunc(jpegxl::ThreadParallelRunner*, int) /src/libjxl/lib/threads/thread_parallel_runner_internal.cc:169:9
#7 0x55ff98cc2ea3 in __invoke<void (*)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int> /usr/local/bin/../include/c++/v1/type_traits:3663:23
#8 0x55ff98cc2ea3 in __thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int, 2UL, 3UL> /usr/local/bin/../include/c++/v1/thread:280:5
#9 0x55ff98cc2ea3 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(jpegxl::ThreadParallelRunner*, int), jpegxl::ThreadParallelRunner*, unsigned int> >(void*) /usr/local/bin/../include/c++/v1/thread:291:5
#10 0x7fb91838f608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
#11 0x7fb91828a292 in __clone /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
0x61a000000504 is located 0 bytes to the right of 1156-byte region [0x61a000000080,0x61a000000504)
allocated by thread T0 here:
#0 0x55ff984af04d in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3
#1 0x55ff984bbcf3 in __libcpp_operator_new<unsigned long> /usr/local/bin/../include/c++/v1/new:245:10
#2 0x55ff984bbcf3 in __libcpp_allocate /usr/local/bin/../include/c++/v1/new:271:10
#3 0x55ff984bbcf3 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator.h:105:38
#4 0x55ff984bbcf3 in allocate /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:262:20
#5 0x55ff984bbcf3 in __split_buffer /usr/local/bin/../include/c++/v1/__split_buffer:306:29
#6 0x55ff984bbcf3 in std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >::__append(unsigned long) /usr/local/bin/../include/c++/v1/vector:1100:53
#7 0x55ff984b5a57 in resize /usr/local/bin/../include/c++/v1/vector:2033:15
#8 0x55ff984b5a57 in DecodeJpegXl /src/libjxl/tools/djxl_fuzzer.cc:398:17
#9 0x55ff984b5a57 in TestOneInput /src/libjxl/tools/djxl_fuzzer.cc:562:3
#10 0x55ff984b5a57 in LLVMFuzzerTestOneInput /src/libjxl/tools/djxl_fuzzer.cc:572:10
#11 0x55ff983a85d3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) cxa_noexception.cpp
#12 0x55ff98394212 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
#13 0x55ff98399a6c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) cxa_noexception.cpp
#14 0x55ff983c2872 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#15 0x7fb91818f0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
Thread T2 created by T0 here:
#0 0x55ff98461bdc in pthread_create /src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:207:3
#1 0x55ff98cc139d in __libcpp_thread_create /usr/local/bin/../include/c++/v1/__threading_support:514:10
#2 0x55ff98cc139d in thread<void (&)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int &, void> /usr/local/bin/../include/c++/v1/thread:307:16
#3 0x55ff98cc139d in construct<std::__1::thread, void (&)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int &> /usr/local/bin/../include/c++/v1/__memory/allocator.h:151:28
#4 0x55ff98cc139d in construct<std::__1::thread, void (&)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int &, void> /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:290:13
#5 0x55ff98cc139d in __construct_one_at_end<void (&)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int &> /usr/local/bin/../include/c++/v1/vector:933:5
#6 0x55ff98cc139d in emplace_back<void (&)(jpegxl::ThreadParallelRunner *, int), jpegxl::ThreadParallelRunner *, unsigned int &> /usr/local/bin/../include/c++/v1/vector:1693:9
#7 0x55ff98cc139d in jpegxl::ThreadParallelRunner::ThreadParallelRunner(int) /src/libjxl/lib/threads/thread_parallel_runner_internal.cc:196:14
#8 0x55ff98cbfab8 in JxlThreadParallelRunnerCreate /src/libjxl/lib/threads/thread_parallel_runner.cc:81:19
#9 0x55ff984b1ef1 in JxlThreadParallelRunnerMake /src/libjxl/lib/include/jxl/thread_parallel_runner_cxx.h:59:7
#10 0x55ff984b1ef1 in DecodeJpegXl /src/libjxl/tools/djxl_fuzzer.cc:76:17
#11 0x55ff984b1ef1 in TestOneInput /src/libjxl/tools/djxl_fuzzer.cc:562:3
#12 0x55ff984b1ef1 in LLVMFuzzerTestOneInput /src/libjxl/tools/djxl_fuzzer.cc:572:10
#13 0x55ff983a85d3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) cxa_noexception.cpp
#14 0x55ff98394212 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
#15 0x55ff98399a6c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) cxa_noexception.cpp
#16 0x55ff983c2872 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#17 0x7fb91818f0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libjxl/lib/jxl/dec_reconstruct.cc:199:10 in StoreRGBA<hwy::N_SCALAR::Simd<unsigned char, 1>, hwy::N_SCALAR::Vec1<unsigned char> >
Shadow bytes around the buggy address:
0x0c347fff8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff8060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff8070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff8090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c347fff80a0:[04]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c347fff80b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c347fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c347fff80d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff80e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c347fff80f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==1239039==ABORTING
```
| Heap-buffer-overflow in StoreRGBA | https://api.github.com/repos/libjxl/libjxl/issues/1041/comments | 1 | 2021-12-22T16:13:54Z | 2021-12-30T13:06:33Z | https://github.com/libjxl/libjxl/issues/1041 | 1,086,978,326 | 1,041 |
[
"libjxl",
"libjxl"
] | When transcoding old image files for archiving, it would be nice to have an option to let the transcoded files keep the modification date and time of the original files. | cjxl, djxl: Add option to preserve file modification timestamp | https://api.github.com/repos/libjxl/libjxl/issues/1038/comments | 7 | 2021-12-22T07:07:03Z | 2024-01-04T22:30:01Z | https://github.com/libjxl/libjxl/issues/1038 | 1,086,518,924 | 1,038 |
[
"libjxl",
"libjxl"
] | Run `./build/tools/djxl ./third_party/testdata/jxl/spline_on_first_frame.jxl ./out.{format}`
|{format}|result|debug messages|
|-|-|-|
|jpg|OK|
|exr|OK|
|png|wrong image (intermediate frame)|
|apng|"Failed to write decoded image."|"Cannot encode using Codec::kUnknown"|
|gif|"Failed to write decoded image."|"Encoding to GIF is not implemented"|
|pnm|"Failed to write decoded image."|"Cannot encode using Codec::kUnknown"|
|psd|"Failed to write decoded image."|"PSD encoding not yet implemented"|
|pgx|"Failed to write decoded image."|"PGX encoder ignoring metadata - use a different codec", "PGX: must be grayscale"|
|pfm|"terminated by signal SIGILL (Illegal instruction)"|JXL_ASSERT: io.frames.size() == 1 || io.metadata.m.have_animation|
|abracadabra|"Failed to write decoded image."|"Cannot encode using Codec::kUnknown"|
At least, for "gif" and _unknown_ we should have more meaningful report.
| Decoding is inconsistent across output formats | https://api.github.com/repos/libjxl/libjxl/issues/1029/comments | 4 | 2021-12-20T10:21:44Z | 2024-03-04T10:12:36Z | https://github.com/libjxl/libjxl/issues/1029 | 1,084,612,015 | 1,029 |
[
"libjxl",
"libjxl"
] | When encoding an image, if the JxlBasicInfo specifies an alpha channel, and I add a frame that has no alpha channel, the resulting encoded frame is completely transparent.
**To Reproduce**
- Call JxlEncoderSetBasicInfo using a JxlBasicInfo with, e.g., `num_color_channels = 3, num_extra_channels = 1, alpha_bits = 8`.
- Call JxlEncoderAddImageFrame using a JxlPixelFormat with `num_channels = 3`.
- The resulting encoded frame is transparent.
**Expected behavior**
Assuming it's valid API usage to mix frames with different JxlPixelFormats, I'd expect that when I call JxlEncoderAddImageFrame with a JxlPixelFormat that specifies only 3 channels, the encoder treats every pixel as fully opaque, regardless of whether the overall image has an alpha channel.
If it's not valid I'd expect an error :)
**Environment**
- OS: Linux 5.11.0-41-generic (Kubuntu)
- Compiler version: gcc 10.3.0
- CPU type: x86_64
- cjxl/djxl version string: JPEG XL encoder v0.7.0 f8c9f02 [AVX2,SSE4,SSSE3,Scalar]
**Additional context**
This situation came about when I was testing some code that merges several JXLs into a single multi-layer JXL. For each input file, I use the minimal pixel format that can accurately represent the encoded pixels - some include an alpha channel and some don't.
**Workaround**
Always use a pixel buffer with an interleaved alpha channel for frames that will be added to JXL with transparency, at the cost of higher memory use. | Adding a 3-channel RGB frame to a 4-channel RGBA image results in a fully-transparent frame. | https://api.github.com/repos/libjxl/libjxl/issues/1026/comments | 2 | 2021-12-17T14:44:56Z | 2022-05-19T16:11:13Z | https://github.com/libjxl/libjxl/issues/1026 | 1,083,328,811 | 1,026 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
The following tests are consistently failing on big-endian arches:
```
656 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBAtoRGBAf16#GetParam()=301x33RGBAtoRGBAf16 (Failed)
662 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBAtoRGBAf16Callback#GetParam()=301x33RGBAtoRGBAf16Callback (Failed)
668 - DecodeTest/DecodeTestParam.PixelTest/301x33GtoGf16#GetParam()=301x33GtoGf16 (Failed)
674 - DecodeTest/DecodeTestParam.PixelTest/301x33GtoGf16Callback#GetParam()=301x33GtoGf16Callback (Failed)
680 - DecodeTest/DecodeTestParam.PixelTest/301x33GAtoGf16#GetParam()=301x33GAtoGf16 (Failed)
686 - DecodeTest/DecodeTestParam.PixelTest/301x33GAtoGf16Callback#GetParam()=301x33GAtoGf16Callback (Failed)
692 - DecodeTest/DecodeTestParam.PixelTest/301x33GAtoGAf16#GetParam()=301x33GAtoGAf16 (Failed)
698 - DecodeTest/DecodeTestParam.PixelTest/301x33GAtoGAf16Callback#GetParam()=301x33GAtoGAf16Callback (Failed)
704 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBtoRGBf16#GetParam()=301x33RGBtoRGBf16 (Failed)
710 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBtoRGBf16Callback#GetParam()=301x33RGBtoRGBf16Callback (Failed)
716 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBAtoRGBf16#GetParam()=301x33RGBAtoRGBf16 (Failed)
722 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBAtoRGBf16Callback#GetParam()=301x33RGBAtoRGBf16Callback (Failed)
728 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBtoRGBAf16#GetParam()=301x33RGBtoRGBAf16 (Failed)
734 - DecodeTest/DecodeTestParam.PixelTest/301x33RGBtoRGBAf16Callback#GetParam()=301x33RGBtoRGBAf16Callback (Failed)
963 - RobustStatisticsTest.CleanLine (Failed)
```
**To Reproduce**
* https://buildd.debian.org/status/fetch.php?pkg=jpeg-xl&arch=s390x&ver=0.6.1%2Bds-5&stamp=1639585115&raw=0
* https://buildd.debian.org/status/fetch.php?pkg=jpeg-xl&arch=ppc64&ver=0.6.1%2Bds-5&stamp=1639586654&raw=0
**Expected behavior**
It would be nice if tests would report consistent results across arch endianess.
**Environment**
- OS: Linux
- Compiler version: gcc-11
- CPU type: ppc64 & s390x
- cjxl/djxl version string: 0.6.1
| Some tests are failing on big-endian arch | https://api.github.com/repos/libjxl/libjxl/issues/1024/comments | 7 | 2021-12-17T08:07:45Z | 2024-03-04T10:12:35Z | https://github.com/libjxl/libjxl/issues/1024 | 1,082,991,995 | 1,024 |
[
"libjxl",
"libjxl"
] | **Is your feature request related to a problem? Please describe.**
for a neophite user like me, correctly filling basic_info could be hard.
**Describe the solution you'd like**
Adding an API to fill basic_info for colorspaces like RGB, RGBA, etc...
thank you
| Add an API to fill basic info in some scenarii | https://api.github.com/repos/libjxl/libjxl/issues/1021/comments | 1 | 2021-12-15T16:31:41Z | 2022-04-07T08:34:39Z | https://github.com/libjxl/libjxl/issues/1021 | 1,081,244,564 | 1,021 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
jxl library properly uses a jxl.version script to hide some of the c++ symbols. This is not the case for jxl_threads. Please apply similar logic.
**To Reproduce**
When building on amd64, the c++ symbols being exported depends on the libstdc++ version:
* https://buildd.debian.org/status/fetch.php?pkg=jpeg-xl&arch=amd64&ver=0.6.1%2Bds-4&stamp=1639576462&raw=0
```
dpkg-gensymbols: error: some symbols or patterns disappeared in the symbols file: see diff output below
dpkg-gensymbols: warning: debian/libjxl0.6/DEBIAN/symbols doesn't match completely debian/libjxl0.6.symbols
--- debian/libjxl0.6.symbols (libjxl0.6_0.6.1+ds-4_amd64)
+++ dpkg-gensymbolsHmRRaw 2021-12-15 13:54:15.234900884 +0000
@@ -79,7 +79,7 @@
JxlThreadParallelRunnerDefaultNumWorkerThreads@Base 0.6.1
JxlThreadParallelRunnerDestroy@Base 0.6.1
_ZNSt6vectorISt6threadSaIS0_EE17_M_default_appendEm@Base 0.6.1
- _ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJRFvPN6jpegxl20ThreadParallelRunnerEiES6_RjEEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_@Base 0.6.1
+#MISSING: 0.6.1+ds-4# _ZNSt6vectorISt6threadSaIS0_EE17_M_realloc_insertIJRFvPN6jpegxl20ThreadParallelRunnerEiES6_RjEEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_@Base 0.6.1
_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN6jpegxl20ThreadParallelRunnerEiES5_jEEEEEE@Base 0.6.1
_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN6jpegxl20ThreadParallelRunnerEiES5_jEEEEEE@Base 0.6.1
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN6jpegxl20ThreadParallelRunnerEiES5_jEEEEEE@Base 0.6.1
dh_makeshlibs: error: failing due to earlier errors
```
**Expected behavior**
Do not export symbols other than those starting with Jxl.
**Screenshots**
* https://buildd.debian.org/status/fetch.php?pkg=jpeg-xl&arch=amd64&ver=0.6.1%2Bds-4&stamp=1639576462&raw=0
**Environment**
- OS: Linux/Debian/Sid
- Compiler version: gcc-11
- CPU type: all
| jxl_threads: There is not point in exposing the underlying c++ symbols | https://api.github.com/repos/libjxl/libjxl/issues/1017/comments | 1 | 2021-12-15T14:48:49Z | 2021-12-15T21:51:18Z | https://github.com/libjxl/libjxl/issues/1017 | 1,081,130,251 | 1,017 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
```
/usr/bin/python3.9 /usr/bin/a2x --format manpage --destination-dir="/home/malat/jpeg-xl-0.6.1+ds/obj-x86_64-linux-gnu" /home/malat/jpeg-xl-0.6.1+ds/doc/man/cjxl.txt
File "/usr/bin/a2x", line 2
python3 -m asciidoc.a2x "$@"
^
SyntaxError: invalid syntax
```
**To Reproduce**
Use a Debian/sid schroot:
* https://buildd.debian.org/status/fetch.php?pkg=jpeg-xl&arch=amd64&ver=0.6.1%2Bds-3&stamp=1639562050&raw=0
For reference:
```
% apt-cache policy asciidoc-base
asciidoc-base:
Installed: 10.0.2-1
Candidate: 10.0.2-1
Version table:
*** 10.0.2-1 500
500 https://deb.debian.org/debian sid/main amd64 Packages
100 /var/lib/dpkg/status
```
leads to:
```
% head /usr/bin/a2x
#!/bin/sh
python3 -m asciidoc.a2x "$@"
```
**Expected behavior**
man page should be generated without errors.
**Environment**
- OS: Linux/Debian/sid
- a2x version >= 10
| python3 -m asciidoc.a2x "$@" SyntaxError: invalid syntax | https://api.github.com/repos/libjxl/libjxl/issues/1015/comments | 1 | 2021-12-15T10:51:15Z | 2022-04-07T10:59:16Z | https://github.com/libjxl/libjxl/issues/1015 | 1,080,886,614 | 1,015 |
[
"libjxl",
"libjxl"
] | **Is your feature request related to a problem? Please describe.**
I've uploaded jpeg-xl to Debian repo. To keep source code small in between patch release, I'd like to have the testdata in a separate repo:
Typically:
```
% du -sh third_party/testdata
19M third_party/testdata
```
It is very unlikely that this testdata changes as often as the source code.
**Describe the solution you'd like**
Have a separate repo (submodule?) for testdata.
**Describe alternatives you've considered**
I could do it myself of course. It would be nice to have a comment from upstream, if feature is accepted or not.
| Remove `third_party/testdata` from the main libjxl repo | https://api.github.com/repos/libjxl/libjxl/issues/1013/comments | 2 | 2021-12-15T09:08:28Z | 2024-03-04T10:12:35Z | https://github.com/libjxl/libjxl/issues/1013 | 1,080,770,904 | 1,013 |
[
"libjxl",
"libjxl"
] |
authors of winpthreads are saying that it is slower than a usage of "native" thread API
as there is already a usage of the win32 thread API with Visual Studio, would it be possible to also use it with mingw ?
thank you
| with mingw, winpthread is slow | https://api.github.com/repos/libjxl/libjxl/issues/995/comments | 2 | 2021-12-13T10:13:11Z | 2022-04-07T13:49:01Z | https://github.com/libjxl/libjxl/issues/995 | 1,078,327,014 | 995 |
[
"libjxl",
"libjxl"
] | **Is your feature request related to a problem? Please describe.**
I was trying to decode a JXL image into a gdk pixbuf. Unfortunately, allocating
a pixbuf with the same pixel dimensions as the JXL output and passing the result of gdk_pixbuf_get_byte length into JxlDecoderSetImageOutBuffer fails because libjxl requires extra space after the last pixel that gdk pixbuf does not provide.
Specifically, if row_size is the size of a pixel row in bytes, and row_skip is the extra space reserved between rows (i.e. align - row_size), then libjxl seems to use something like this formula:
image_size = (row_size + row_skip) * rows
While gdk pixbuf uses something like:
image_size = (row_size + row_skip) * (rows - 1) + row_size
i.e. it does not require extra alignment space after the pixels in the last row to actually exist.
The gdk buffer is thgerefore always smaller if extra alignment is needed, and therefore, jxl considers the buffer too small. This is a common case, as gdk aligns rows even when not strictly needed (e.g. RGB pixels and odd widths).
**Describe the solution you'd like**
I actually find gdk pixbuf's behaviour here slightly retarded :) However, it does what it does, and it might not be the only library to do so (it might be...). It's also very hard to work around this - you really require an extra copy, or you need to overallocate in non-intuitive ways.
In fact, gdk pixbuf internally allocates a larger buffer of the same size as libjxl expects, but this is not documented, and therefore, might just be an artifact of the current code base.
I see a few ways out of this issue:
- document that the extra space after a row is never accessed. this way, a program using gdk pixbuf cna just pretend the gbuffer is larger and everything would be fine. Documenting that the extra space is never accessed is also beneficial for other reasons, such as when one wants to decode an image into a large buffer (e.g. when preparing a texture atlas).
- mimic the size calculation of gdk pixbuf, i.e. return the number of bytes required from first to last pixel only.
**Describe alternatives you've considered**
There might be other solutions - I just want to bring this issue to your attention. At the moment, I went for simply assuming that gdk overallocates its buffer and returns a smaller byte size than the buffer length, and hoping that libjxl will not access the extra space anyway, even if some future gdk pixbuf version changes the buffer size internally.
| Allow using pixbuf for output buffer | https://api.github.com/repos/libjxl/libjxl/issues/994/comments | 6 | 2021-12-12T17:37:00Z | 2021-12-13T12:45:33Z | https://github.com/libjxl/libjxl/issues/994 | 1,077,864,325 | 994 |
[
"libjxl",
"libjxl"
] | * provide an enum in JxlPixelFormat to choose the colorspace (when num_channels == 4)
* add an implementation similar to RGBA
this will allow toolkits or other drawing tools using BGRA to avoid a colorspace conversion. | decoder: add BGRA output in addition to RGBA | https://api.github.com/repos/libjxl/libjxl/issues/993/comments | 5 | 2021-12-11T20:25:31Z | 2024-04-22T09:48:58Z | https://github.com/libjxl/libjxl/issues/993 | 1,077,640,591 | 993 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
with git of today, compilation of examples/jxlinfo. Output:
```
$ ./jxlinfo.exe ~/gitroot_64/conformance/testcases/animation_spline_5/input.jxl
./lib/jxl/decode.cc:2100: invalid signature
Decoder error
Couldn't print basic info
```
**Expected behavior**
basic info of this file
**Environment**
- OS: Win10
- Compiler version: gcc
- CPU type: x86_64
Highway scalar
| conformance regression with conformance/testcases/animation_spline_5/input.jxl ? | https://api.github.com/repos/libjxl/libjxl/issues/984/comments | 6 | 2021-12-10T05:10:22Z | 2021-12-10T10:01:12Z | https://github.com/libjxl/libjxl/issues/984 | 1,076,435,359 | 984 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
I was encoding some gifs with cjxl and ran into some animated ones that caused a JXL_ASSERT.
./lib/extras/packed_image_convert.cc:112: JXL_ASSERT: frame_rect.IsInside(Rect(0, 0, ppf.info.xsize, ppf.info.ysize))
I managed to make a gif which exhibits this behaviour from an animation in the conformance repository and attached it.
**To Reproduce**
I ran this on the attached gif:
cjxl -d 0.0 -e 7 in.gif out.jxl
**Expected behavior**
cjxl does not run into a JXL_ASSERT.
**Environment**
- OS: Ubuntu 21.10
- Compiler version: gcc version 11.2.0
- CPU type: x86_64
- cjxl/djxl version string: v0.7.0 4ef0372 [SSE4,SSSE3,Scalar]
Was also able to reproduce on Windows 10 with a build of cjxl from https://artifacts.lucaversari.it/libjxl/libjxl/latest/
**Additional context**
I looked into the code briefly, here is some stuff I saw for this gif:
in codec_gif.cc all frames are added into ppf with full dimensions of the animation (128x128)
https://github.com/libjxl/libjxl/blob/3858b8df31a2f38de86fae7c744cac1ecf8681db/lib/extras/codec_gif.cc#L211
Soon after, the origin/offset is set to the origin of the original image_rect, which can be non-zero.
https://github.com/libjxl/libjxl/blob/3858b8df31a2f38de86fae7c744cac1ecf8681db/lib/extras/codec_gif.cc#L226-L227
The resulting frame does not fit into the original dimensions if x0 or y0 are bigger than 0, triggering the assert later in the code.
**Attached Gif**
 | JXL_ASSERT while encoding from gif animation with frames that have non-zero origin | https://api.github.com/repos/libjxl/libjxl/issues/980/comments | 2 | 2021-12-09T17:01:08Z | 2022-01-24T15:33:38Z | https://github.com/libjxl/libjxl/issues/980 | 1,075,798,373 | 980 |
[
"libjxl",
"libjxl"
] | https://github.com/libjxl/libjxl/pull/967 disables the WASM pipeline because the build system for it is not working. We should re-enable it ASAP. | Re-enable the WASM pipeline | https://api.github.com/repos/libjxl/libjxl/issues/968/comments | 0 | 2021-12-08T15:15:26Z | 2021-12-22T13:34:50Z | https://github.com/libjxl/libjxl/issues/968 | 1,074,519,877 | 968 |
[
"libjxl",
"libjxl"
] | **Is your feature request related to a problem? Please describe.**
I'm interested in lossless transcoding of JPEG images - specifically, getting identicalmpixel values out of the image. As far as I can see, this can be done by storing JPEG reconstruction data and reconstructing the original JPEG.
However, when not storing JPEG reconstruction data, this is not possible (apparently, at leats not with the reference API - it would be cool if one could get a non-bit-identical but equivalent JPEG file back), and the only way to get to the pixels seems to be to use the JXL decoder.
**Describe the solution you'd like**
When transcoding a JPEG file losslessly to JXL, it should be possible to get identical pixel values between decoding the original JPEG file and decoding the JXL file. This is not currently the case, even JXL files that can be reconstructed to the original JPEG file will decode to different pixel values when using the JXL decoder.
I understand that this is not directly possible as different jpeg decoders disagree on exact pixel values, but there should be some way to get identical results by picking a standard, for example, using the IJG libjpeg with a certain set of decoder options, where the IJG library and the JPEG-XL reference library would agree on pixel values.
While a workaround is to always reconstruct the JPEG and decode that, that is not possible when losslessly transcoding the JPEG image without reconstruction data, so you end up with a losslessly transcoded jpeg file that has different pixel values in the jxl representation.
**Describe alternatives you've considered**
Documenting that "lossless transcode" does NOT mean you get the same image when decoding the jxl file might be a good first step - the impression I got form documentation is that lossless means I get the same pixels when decoding the JXL image. Possibly that is the only thing that cna be done about it.
Alternatively, documenting that to get identical results, you need to reconstruct the JPEG file, so lossless transcodes REQUIRE jpeg reconstruction data and a JPEG decoder, might help.
Supporting "lossy" JPEG "reconstruction", where one can construct "an" equivalent (pixel-value-wise) JPEG image from a losslessly transcoded JPEG image might help - in that case, one can losslessly convert to JXL, and if one needs the original pixels for verification purposes, one could construct a JPEG file and use both jpeg files in a jpeg decoder of ones choice.
**Additional context**
I'm archiving >>100TB of JPEG (and other) images, and plan to convert most if not all into JXL files. Knowing how to get the exact "original" pixel values is important, to be able to verify that the image has been transcoded correctly. Doing this without the JPEG reconstruction data can yield considerable (for us) space savings in some applications (while mostly we would opt for JPEG reconstruction data to be stored).
Also, at this scale, conversion always requires a verification step, as something always goes wrong.
| make it possible to get the original pixel values from losslessly transcoded jpeg files, or document that it can't be done | https://api.github.com/repos/libjxl/libjxl/issues/950/comments | 7 | 2021-12-05T18:57:50Z | 2022-04-07T17:01:00Z | https://github.com/libjxl/libjxl/issues/950 | 1,071,531,406 | 950 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
While cjxl, which uses an undocumented API, can create jxl files that allow jpeg reconstruction, the official (C) API currently (commit ea2612d6df99e9878b51e315935f9d6201f5fe47) generates corrupt files that can be viewed, but fail to reconstruct to the original JPEG files.
**To Reproduce**
I have an encoder (not written in C) that basically does this:
JxlEncoderCreate
JxlEncoderUseContainer
JxlEncoderStoreJPEGMetadata
JxlEncoderFrameSettingsCreate
JxlEncoderSetFrameLossless
JxlEncoderAddJPEGFrame
JxlEncoderCloseInput
That is, it doesn't set any options and relies on AddJPEGFrame to set defaults. The expectation is that it is possibe to reconstruct the original JPEG from the encoded file. The resulting jxl file is 283kb large and has the following structure:
box: type: "JXL " size: 12
box: type: "ftyp" size: 20
box: type: "jxlp" size: 22
box: type: "jbrd" size: 284
box: type: "jxlp" size: 282464
The image displays fine, i.e. it can be (pixel-)decoded without problems both by djxl as well as by my own image viewer that uses the reference API.
Trying to reconstruct the original JPEG with the C api fails with status 2, while trying to reconstruct using djxl fails with:
Read 282802 compressed bytes.
Unknown compressed image format
Debugging the problem, it seems the Exif information is missing. Indeed, if I use cjxl, I get a different, larger file (316k), with the following structure, which reconstructs fine:
box: type: "JXL " size: 12
box: type: "ftyp" size: 20
box: type: "Exif" size: 8719
box: type: "jbrd" size: 284
box: type: "jxlc" size: 282470
The original JPEG has the following structure:
SOI*(start_of_image) @0x00000000
APP0 @0x00000002
APP1 @0x00000014
APPE @0x00000148
DQT(quantization_table) @0x00000158
SOF0(huff_baseline) @0x0000019d
DRI(restart_interval) @0x000001aa
DHT(huff_table) @0x000001b0
SOS(start_of_scan) @0x00000284
EOI*(end_of_image) @0x00054398
**Expected behavior**
1. JPEG reconstruction should not fail for files encoded by the reference implementation.
2. cjxl and djxl should use the same code to encode/decode as the public library API, and should result in identical results (given the same parameters). Using a special private API for cjxl/djxl will always carry the risk of it being different than the official API.
3. There should be a testsuite for the official API to catch these type of bugs early.
| Reference API generates corrupt JXL files that cannot be decoded to JPEG anymore. | https://api.github.com/repos/libjxl/libjxl/issues/949/comments | 8 | 2021-12-05T05:22:13Z | 2024-03-04T10:12:35Z | https://github.com/libjxl/libjxl/issues/949 | 1,071,375,965 | 949 |
[
"libjxl",
"libjxl"
] | I've been comparing Jpeg-XL recompression of existing jpeg files with PackJPG (https://github.com/packjpg/packJPG) and the latter is giving me ~8% better compression based on a pretty large (2gb) chunk of sample jpegs consisting of primarily photos (nature, faces etc), but also animation and 3d renders.
I was wondering if there's any way to lower this gap in compression efficiency, at first I though that PackJPG might be omitting some data but checksums of the decompressed jpegs showed that they were indeed exactly as the originals.
I tried some more aggressive options, but the best I came across '-I 2 -e 9 -E 3' gave me less than 1% improvement | Jpeg recompression efficiency | https://api.github.com/repos/libjxl/libjxl/issues/934/comments | 6 | 2021-12-01T10:59:21Z | 2021-12-02T06:12:46Z | https://github.com/libjxl/libjxl/issues/934 | 1,068,260,125 | 934 |
[
"libjxl",
"libjxl"
] | I always try to get my code warning free, to see if there is a problem.
When I now compile the lib, I get more then 4000 Warnings for the lib.
Are you interested in fixing this?
They are almost not so special, but if they would be gone, you can find real problems.
One example in ac_context.h
JXL_DASSERT((1u << log2_covered_blocks) == covered_blocks);
warns, because 1u is 32 bit, the rest is 64 bit, better would be
JXL_DASSERT(((size_t)1 << log2_covered_blocks) == covered_blocks);
or
return num_ctxs * kNonZeroBuckets + kZeroDensityContextCount * block_ctx;
creats a 64 Bit value that is implicit converted to 32 bit. Better would be
return (uint32_t)(num_ctxs * kNonZeroBuckets + kZeroDensityContextCount * block_ctx);
to tell the compiler that you know that there will be no problem. The same problem in line 124 and 137.
To be continued. | More then 4000 Warnings when compiling with Visual Studio | https://api.github.com/repos/libjxl/libjxl/issues/933/comments | 2 | 2021-12-01T05:09:05Z | 2022-04-07T10:44:06Z | https://github.com/libjxl/libjxl/issues/933 | 1,067,969,245 | 933 |
[
"libjxl",
"libjxl"
] | I compile the library with Visual Studio.
There is only one place in the code that needs C++ Standard version 20. Can you change it to
const JxlCmsInterface& GetJxlCms() {
static constexpr JxlCmsInterface kInterface = {
nullptr,
&JxlCmsInit,
&JxlCmsGetSrcBuf,
&JxlCmsGetDstBuf,
&DoColorSpaceTransform,
&JxlCmsDestroy};
return kInterface;
}
so it will work with Standard version 14. | Stay on C++ Standard version 14 | https://api.github.com/repos/libjxl/libjxl/issues/932/comments | 2 | 2021-12-01T04:31:04Z | 2021-12-01T19:35:01Z | https://github.com/libjxl/libjxl/issues/932 | 1,067,948,941 | 932 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
This 363 byte file [illegalInstruction.fuzz.txt](https://github.com/libjxl/libjxl/files/7612115/illegalInstruction.fuzz.txt) causes an illegal instruction crash when the decoder is used with the --allow_partial_files and --allow_more_progressive_steps falgs.
**To Reproduce**
djxl illegalInstruction.fuzz.txt --allow_partial_files --allow_more_progressive_steps
**Expected behavior**
The decoder should exit without crashing.
**Screenshots**

**Environment**
- OS: Ubuntu 20.04
- Compiler version: clang 10.0.0
- CPU type: x86_64
- cjxl/djxl version string: djxl v0.6.1 a205468 asan [AVX2,SSE4,SSSE3,Scalar]
**Additional context**
Honggfuzz was used to find the input file.
| Decoder illegal instruction crash with allow_partial_files and allow_more_progressive_steps | https://api.github.com/repos/libjxl/libjxl/issues/919/comments | 3 | 2021-11-27T17:36:34Z | 2024-03-04T10:12:35Z | https://github.com/libjxl/libjxl/issues/919 | 1,065,093,898 | 919 |
[
"libjxl",
"libjxl"
] | code that already worked fine is no longer able to save an image.
What I do in principle:
JxlEncoderPtr enc = JxlEncoderMake(NULL);
JxlThreadParallelRunnerPtr runner = JxlThreadParallelRunnerMake(nullptr, JxlThreadParallelRunnerDefaultNumWorkerThreads());
status = JxlEncoderSetParallelRunner(enc.get(), JxlThreadParallelRunner, runner.get());
status = JxlEncoderSetBasicInfo(enc.get(), &basic_info);
JxlColorEncodingSetToSRGB(&color_encoding, /*is_gray=*/pixelFormat.num_channels < 3);
status = JxlEncoderSetColorEncoding(enc.get(), &color_encoding);
encoderOptions = JxlEncoderOptionsCreate(enc.get(), nullptr);
status = JxlEncoderOptionsSetDistance(encoderOptions, quality);
status = JxlEncoderOptionsSetLossless(encoderOptions, FALSE);
status = JxlEncoderAddImageFrame(encoderOptions, &pixelFormat, buffer, (size_t)buffer.getSize());
status = JxlEncoderProcessOutput(enc.get(), &next_out, &avail_out);
this goes to RefillOutputByteQueu, WriteHeader, WriteImageMetadata, .... and ends in AllDefault
Bundle::AllDefault ... JXL_ABORT("AllDefault should never fail");
Little bit complex, I know, but it did work in the past. But not with the latest library.
What am I doing wrong? | Saving JPEG XL ends in jxl::Abort | https://api.github.com/repos/libjxl/libjxl/issues/917/comments | 9 | 2021-11-26T16:58:32Z | 2022-04-07T10:42:37Z | https://github.com/libjxl/libjxl/issues/917 | 1,064,695,613 | 917 |
[
"libjxl",
"libjxl"
] | JxlEncoderStatus JxlEncoderOptionsSetDistance(JxlEncoderOptions* options, float distance)
there is a line:
if (distance < 6.56f) {
jpeg_quality = -5.456783f * std::log(0.0256f * distance - 0.16384f);
} else {
jpeg_quality = -11.11111f * distance + 101.11111f;
}
this generates a crash, because log of negative values is not possible.
It should be
if (distance > 6.56f) {
| Crash when trying to save. | https://api.github.com/repos/libjxl/libjxl/issues/915/comments | 1 | 2021-11-26T08:42:22Z | 2021-11-26T16:58:53Z | https://github.com/libjxl/libjxl/issues/915 | 1,064,224,357 | 915 |
[
"libjxl",
"libjxl"
] | ```
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libqt5x11extras5-dev:i386 : Depends: libqt5x11extras5:i386 (= 5.12.8-0ubuntu1) but it is not going to be installed
qtbase5-dev:i386 : Depends: libqt5concurrent5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5core5a:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5dbus5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5gui5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5network5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5printsupport5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5sql5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5test5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5widgets5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libqt5xml5:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
Recommends: libqt5opengl5-dev:i386 (= 5.12.8+dfsg-0ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
```
Going to "disable" this job for a while to unblock commit queue. | CI: Cross-compiling i686-linux-gnu job is broken | https://api.github.com/repos/libjxl/libjxl/issues/910/comments | 1 | 2021-11-25T15:52:47Z | 2021-12-22T13:34:30Z | https://github.com/libjxl/libjxl/issues/910 | 1,063,743,647 | 910 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
The build instruction for JXL on Debian are located at:
* https://github.com/libjxl/libjxl/blob/main/doc/developing_in_debian.md
As you can observe there is no specific requirement on how `libstdc++` was built. In particular it seems to imply that the default `libstdc++` built without `-fno-exceptions` can be used.
However looking at the source code, one can check in version 0.6.1 that libjxl is built with `-fno-exceptions`:
* https://github.com/libjxl/libjxl/blob/v0.6.1/lib/CMakeLists.txt#L103
Since the entire codebase rely on the STL, it is not clear how you handle exceptions thrown by the `libstdc++` (typically the codebase makes use of the throwing `new` operator). Grepping through the codebase 0.6.1 I did not see usage of the `nothrow` applied on the new operator.
Could you please add some more documentation on this subject, the only piece of information is:
* https://github.com/libjxl/libjxl/blob/v0.6.1/lib/jxl/jxl.version#L10-L11
> We don't use C++ std types in the API and we also don't support exceptions in the library. | libstdc++: Clarify build instructions on Debian | https://api.github.com/repos/libjxl/libjxl/issues/904/comments | 5 | 2021-11-25T08:08:43Z | 2024-03-04T10:12:35Z | https://github.com/libjxl/libjxl/issues/904 | 1,063,271,203 | 904 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
segfault in JxlDecoderProcessInput(), it seems (i print something before and after this function, and the print after is no displayed)
**To Reproduce**
code below, when trying to display conformance/testcases/alpha_premultiplied/input.jxl. Note that conformance/testcases/alpha_nonpremultiplied/input.jxl seems to work
**Expected behavior**
jxl image displayed...
**Environment**
- OS: Win10
- Compiler version:g++ 11.2
- CPU type: x86_64
relevant code :
```
#define err(msg) \
do { printf(" * %s\n", msg); fflush(stdout); } while (0)
typedef struct
{
Ecore_Evas *ee;
Evas_Object *bg;
Evas_Object *img;
unsigned int *pixels;
unsigned char *file_data;
size_t file_data_size;
JxlParallelRunner *runner;
JxlDecoder *decoder;
JxlPixelFormat pixel_format;
JxlFrameHeader frame_header;
int w;
int h;
int alpha;
unsigned char *icc_profile;
size_t icc_size;
} Data;
int jxl_head(Data *d)
{
JxlDecoderStatus st;
d->runner = JxlResizableParallelRunnerCreate(NULL);
if (!d->runner)
{
err("JxlResizableParallelRunnerCreate failed");
return 0;
}
d->decoder = JxlDecoderCreate(NULL);
if (!d->decoder)
{
err("can not create decoder");
goto destroy_runner;
}
st = JxlDecoderSetParallelRunner(d->decoder,
JxlResizableParallelRunner,
d->runner);
if (st != JXL_DEC_SUCCESS)
{
err("can not create decoder");
goto destroy_decoder;
}
st = JxlDecoderSetKeepOrientation(d->decoder, JXL_TRUE);
if (st != JXL_DEC_SUCCESS)
{
err("can not keep orientation");
goto destroy_decoder;
}
st = JxlDecoderSubscribeEvents(d->decoder,
JXL_DEC_BASIC_INFO |
JXL_DEC_COLOR_ENCODING |
JXL_DEC_FRAME |
JXL_DEC_FULL_IMAGE);
if (st != JXL_DEC_SUCCESS)
{
err("can not subscribe events");
goto destroy_decoder;
}
st = JxlDecoderSetInput(d->decoder, d->file_data, d->file_data_size);
if (st != JXL_DEC_SUCCESS)
{
err("can not set input");
goto destroy_decoder;
}
JxlDecoderCloseInput(d->decoder);
d->pixel_format.num_channels = 4;
d->pixel_format.data_type = JXL_TYPE_UINT8;
d->pixel_format.endianness = JXL_LITTLE_ENDIAN;
d->pixel_format.align = 0;
for (;;)
{
err("process input begin");
st = JxlDecoderProcessInput(d->decoder);
err("process input end");
switch (st)
{
case JXL_DEC_ERROR:
err("can not process input");
goto release_input;
case JXL_DEC_NEED_MORE_INPUT:
err("Error, input already passed");
goto release_input;
case JXL_DEC_BASIC_INFO:
{
JxlBasicInfo basic_info;
JxlDecoderStatus s;
err("ev basic info");
s = JxlDecoderGetBasicInfo(d->decoder, &basic_info);
if (s != JXL_DEC_SUCCESS)
{
err("can not retrieve basic info");
goto release_input;
}
d->w = basic_info.xsize;
d->h = basic_info.ysize;
d->alpha = !!basic_info.alpha_bits;
printf(" img size: %d %d (alpha %d) (num chan %d)\n", d->w, d->h, d->alpha, basic_info.num_color_channels);
fflush(stdout);
d->pixels = (unsigned int *)malloc(d->w * d->h * 4);
if (!d->pixels)
{
err("can not alloc pixels");
goto release_input;
}
JxlResizableParallelRunnerSetThreads(
d->runner,
JxlResizableParallelRunnerSuggestThreads(d->w, d->h));
_resize(d,
d->w, d->h);
break;
}
case JXL_DEC_COLOR_ENCODING:
{
JxlDecoderStatus s;
err("ev color encoding");
s = JxlDecoderGetICCProfileSize(d->decoder,
&d->pixel_format,
JXL_COLOR_PROFILE_TARGET_DATA,
&d->icc_size);
if (s != JXL_DEC_SUCCESS)
{
err("can not retrieve icc size\n");
goto release_input;
}
d->icc_profile = (unsigned char *)malloc(d->icc_size);
if (!d->icc_profile)
{
err("can not allocate icc profile\n");
goto release_input;
}
s = JxlDecoderGetColorAsICCProfile(d->decoder,
&d->pixel_format,
JXL_COLOR_PROFILE_TARGET_DATA,
d->icc_profile,
d->icc_size);
if (s != JXL_DEC_SUCCESS)
{
printf("can not get icc profile\n");
fflush(stdout);
goto release_input;
}
break;
}
case JXL_DEC_FRAME:
{
JxlDecoderGetFrameHeader(d->decoder, &d->frame_header);
printf(" * ev frame : %u %u %u %d\n",
d->frame_header.duration,
d->frame_header.timecode,
d->frame_header.name_length,
d->frame_header.is_last);
fflush(stdout);
break;
}
case JXL_DEC_NEED_IMAGE_OUT_BUFFER:
{
size_t buffer_size;
JxlDecoderStatus s;
err("need image output buffer");
s = JxlDecoderImageOutBufferSize(d->decoder,
&d->pixel_format,
&buffer_size);
if (s != JXL_DEC_SUCCESS)
{
err("JxlDecoderImageOutBufferSize failed");
goto release_input;
}
printf(" %d %d\n", (int)buffer_size, (int)(d->w * d->h * 4));
fflush(stdout);
s = JxlDecoderSetImageOutBuffer(d->decoder,
&d->pixel_format,
d->pixels,
d->w * d->h * 4);
if (s != JXL_DEC_SUCCESS)
{
err("JxlDecoderSetImageOutBuffer failed");
goto release_input;
}
err("need image output buffer fin");
break;
}
case JXL_DEC_FULL_IMAGE:
{
cmsHPROFILE source_icc;
cmsHPROFILE rgb_icc;
cmsHTRANSFORM trans;
unsigned int *m;
err("full image");
source_icc = cmsOpenProfileFromMem(d->icc_profile, d->icc_size);
if (!source_icc)
{
err("cmsOpenProfileFromMem failed");
goto release_input;
}
rgb_icc = cmsCreate_sRGBProfile();
if (!rgb_icc)
{
err("cmsCreate_sRGBProfile failed");
goto release_input;
}
trans = cmsCreateTransform(source_icc, TYPE_RGBA_8, rgb_icc, TYPE_BGRA_8, INTENT_PERCEPTUAL, 0);
if (!trans)
{
err("cmsCreateTransform failed");
goto release_input;
}
m = evas_object_image_data_get(d->img, 1);
cmsDoTransform(trans, d->pixels, m, d->w * d->h);
evas_object_image_data_set(d->img, m);
evas_object_image_data_update_add(d->img,
0, 0,
d->w,
d->h);
break;
}
case JXL_DEC_SUCCESS:
err("ev success");
goto done;
default:
break;
}
}
done:
return 1;
release_input:
JxlDecoderReleaseInput(d->decoder);
destroy_decoder:
JxlDecoderDestroy(d->decoder);
destroy_runner:
JxlResizableParallelRunnerDestroy(d->runner);
return 0;
}
```
backtrace (bt f) :
```
#0 0x00007ffe1f5aaa09 in jxl::N_AVX2::DecodeGroupImpl (
get_block=0x9b4b9fdd00, group_dec_cache=0x23d306c5620,
dec_state=0x23d2f439fd0, thread=7, group_idx=3, decoded=0x23d2f441050,
draw=jxl::kDraw)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:414
block = 0x23d32f509c0
sbx = {0, 0, 0}
acs = {static kMaxCoeffBlocks = 32, static kMaxBlockDim = 256,
static kMaxCoeffArea = 65536,
strategy_ = jxl::AcStrategy::DCT64X64, is_first_ = true}
llf_x = 8
qblock = {{ptr32 = 0x23d32f60b40, ptr16 = 0x23d32f60b40}, {
ptr32 = 0x23d32f62b40, ptr16 = 0x23d32f62b40}, {
ptr32 = 0x23d32f64b40, ptr16 = 0x23d32f64b40}}
log2_covered_blocks = <optimized out>
covered_blocks = 64
size = 4096
abs_tx = 12
x_cc_mul = {raw = {0, 0, 0, 0, 0, 0, 0, 0}}
b_cc_mul = <optimized out>
tx = 0
dc_rows = {0x23d2f472400, 0x23d30756c80, 0x23d3076b500}
row_cmap = {0x23d2f43e780 "", 0x0, 0x23d2f43c880 ""}
bx = <optimized out>
sby = {0, 0, 0}
row_quant = 0x23d30660800
ty = 0
acs_row = <optimized out>
idct_row = {0x23d31d74a00, 0x23d321aca80, 0x23d325e0b00}
jpeg_row = {0x0, 0x0, 0x0}
by = 0
kGroupDataXBorder = 40
kGroupDataYBorder = 18
block_rect = <optimized out>
ac_strategy = @0x23d2f43a2b0: {layers_ = {<jxl::PlaneBase> = {
xsize_ = 128, ysize_ = 128, orig_xsize_ = 128,
orig_ysize_ = 128, bytes_per_row_ = 256,
bytes_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}}, <No data fields>},
row_ = 0x23d30657e00 "%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$%$$$$$$$\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒\r▒"..., stride_ = 256, static INVALID = 255 '▒'}
xsize_blocks = 32
ysize_blocks = 32
dc_stride = <optimized out>
inv_global_scale = <optimized out>
dequant_matrices = <optimized out>
cs = @0x23d2f43a000: {<jxl::Fields> = {
_vptr.Fields = 0x7ffe1f6b1a10 <vtable for jxl::YCbCrChromaSubsampling+16>}, static kHShift = "\000\001\001",
static kVShift = <same as static member of an already seen type>,
channel_mode_ = {0, 0, 0}, maxhs_ = 0 '\000', maxvs_ = 0 '\000'}
idct_stride = 1056
scaled_qtable = <optimized out>
ac_type = <optimized out>
dequant_block = 0x7ffe1f634d20 <jxl::N_AVX2::DequantBlock<(jxl::ACType)0>(jxl::AcStrategy const&, float, int, float, float, hwy::N_AVX2::Vec256<float>, hwy::N_AVX2::Vec256<float>, unsigned long long, unsigned long long, jxl::Quantizer const&, float const*, unsigned long long, unsigned long long const*, float const* restrict*, unsigned long long, float const*, jxl::ACPtr*, float*)>
accumulate = 254
offset = 4096
jpeg_c_map = {_M_elems = {0, 0, 0}}
jpeg_is_gray = false
dcoff = {_M_elems = {0, 0, 0}}
hshift = {0, 0, 0}
vshift = {0, 0, 0}
r = {{x0_ = 96, y0_ = 0, xsize_ = 32, ysize_ = 32}, {x0_ = 96,
y0_ = 0, xsize_ = 32, ysize_ = 32}, {x0_ = 96, y0_ = 0,
xsize_ = 32, ysize_ = 32}}
#1 0x00007ffe1f5ac033 in jxl::DecodeGroup (
readers=readers@entry=0x9b4b9ffb20, num_passes=num_passes@entry=1,
group_idx=group_idx@entry=3, dec_state=0x23d2f439fd0,
group_dec_cache=group_dec_cache@entry=0x23d306c5620,
thread=thread@entry=7, decoded=0x23d2f441050, first_pass=0,
force_draw=force_draw@entry=false, dc_only=dc_only@entry=false)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:756
jxl_return_if_error_status = <optimized out>
draw = <optimized out>
histo_selector_bits = 0
get_block = {<jxl::GetBlock> = {
_vptr.GetBlock = 0x7ffe1f6a1fa0 <vtable for jxl::(anonymous namespace)::GetBlockFromBitstream+16>}, shift_for_pass = 0x23d2f43a0b0,
coeff_orders = 0x23d3077f710, coeff_order_size = 19200,
context_map = 0x23d2f43ff00, decoders = {{
static kMaxCheckpointInterval = 512,
alias_tables_ = 0x23d30793880, huffman_data_ = 0x0,
use_prefix_code_ = false, state_ = 88271543,
configs = 0x23d2f43fc70, log_alpha_size_ = 7,
log_entry_size_ = 5, entry_size_minus_1_ = 31,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 120 times>}, num_special_distances_ = 0}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x0, use_prefix_code_ = false,
state_ = 1245184, configs = 0x0, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 0,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
0 <repeats 82 times>, 262148, 0, 0, 0, 0, 0, 0, 0, 262148, 0,
634, 0, 766574928, 573, 634, 0, 634, 0, 634, 0, 766574592,
573, 766574592, 573, 2831737513, 32766, 766575336, 573,
766574592, 573, 766574593, 573, 127, 32766, 634, 0,
766908464, 573}, num_special_distances_ = 634}, {
static kMaxCheckpointInterval = 512,
alias_tables_ = 0x7ffea8c8ead2 <ntdll!RtlGetFullPathName_UstrEx+4674>, huffman_data_ = 0x23d2db61820, use_prefix_code_ = false,
state_ = 1245184, configs = 0x23d2db10000,
log_alpha_size_ = 766908448, log_entry_size_ = 573,
entry_size_minus_1_ = 127, static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
766908448, 573, 2831672233, 32766, 766574592, 573,
1268772384, 155, 766908448, 573, 375, 0, 259, 0, 375, 0, 375,
0, 766574592, 573, 1268773209, 155, 2831737513, 32766,
766575336, 573, 766574928, 573, 257, 0, 127, 0, 766908448,
573, 375, 0, 766912608, 573, 2831805791, 32766, 766574592,
573, 1268773209, 155, 766912592, 573, 766574928, 573, 127, 0,
375, 0, 1268773120, 155, 259, 0, 766575108, 573, 766908464,
573, 0, 0, 0, 0, 766908448, 573, 122, 0, 375, 0, 2831805791,
32766, 83968003, 573, 1268773337, 155, 48, 0, 766906160, 1,
766908448, 573, 122, 0, 0, 0, 127, 0, 1492, 0, 766906480,
573, 0, 0, 127, 0, 766906464, 573, 127, 1, 122, 0, 766574928,
573, 83886083, 0, 2, 0, 127, 0, 134480398, 0, 766906464, 573,
8, 0, 766912624, 573, 122, 0},
num_special_distances_ = 1066}, {
static kMaxCheckpointInterval = 512,
alias_tables_ = 0x23d2dae0150, huffman_data_ = 0x42a,
use_prefix_code_ = 42, state_ = 1245184, configs = 0x42a,
log_alpha_size_ = 134480398, log_entry_size_ = 573,
entry_size_minus_1_ = 766378728, static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
2392, 0, 3942908143, 573, 766378728, 573, 2831737417, 32766,
766378728, 573, 854908192, 573, 766377985, 573, 127, 32766,
2392, 0, 854985296, 573, 2392, 0, 2831739602, 32766,
854985280, 573, 850853888, 573, 766377984, 573, 854985280,
573, 127, 573, 2392, 0, 850853888, 573, 83951620, 573,
766378728, 573, 24944, 0, 1559, 0, 134480398, 573, 854985280,
573, 2831672233, 32766, 766377984, 573, 1268773168, 155,
854985280, 573, 833, 0, 1559, 0, 833, 0, 833, 0, 3942908143,
573, 766378728, 573, 2831737417, 32766, 766378728, 573,
766378320, 573, 1537, 0, 127, 0, 854985280, 573, 833, 0,
855010240, 573, 2831805791, 32766, 766377984, 573,
1268773993, 155, 855010224, 573, 766378320, 573, 127, 0, 833,
0, 83886080, 573, 1559, 0, 4, 0, 854985296, 573, 0, 0, 0, 0,
854985280, 573, 127, 0, 833, 0, 766908464, 573},
num_special_distances_ = 83886083}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x7f,
huffman_data_ = 0x30, use_prefix_code_ = true,
state_ = 1245184, configs = 0x23d32f60a40,
log_alpha_size_ = 766378320, log_entry_size_ = 573,
entry_size_minus_1_ = 134480398, static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
766574593, 573, 766378320, 573, 134480398, 0, 0, 0, 127, 0,
38240, 0, 854908208, 573, 854919232, 573, 855010256, 573, 63,
0, 1268773720, 155, 134480398, 573, 766378696, 573,
100925442, 0, 0, 0, 24944, 0, 854985296, 573, 855010208, 573,
0, 0, 64, 0, 0, 0, 1577321048, 32766, 766378688, 573, 5922,
0, 0, 0, 0, 0, 1342177635, 0, 0, 0, 11024, 0, 11008, 0, 1, 0,
766377984, 573, 689, 0, 2831791181, 32766, 766377984, 573,
1342177635, 0, 1342177635, 0, 0, 0, 24912, 0, 24896, 0, 1, 0,
766377984, 573, 1557, 0, 2831791181, 32766, 766377984, 573,
1342177635, 0, 24896, 0, 1, 0, 0, 0, 1268773876, 155,
766377984, 4, 0, 0, 4294967282, 0, 2832020033, 32766, 11008,
0, 0, 0, 11024, 0, 1, 0, 766377984, 573, 2832638630, 32766},
num_special_distances_ = 766377984}, {
static kMaxCheckpointInterval = 512, alias_tables_ = 0x0,
huffman_data_ = 0x23d2dae02c0, use_prefix_code_ = 65,
state_ = 1245184, configs = 0xffffffe2, log_alpha_size_ = 0,
log_entry_size_ = 0, entry_size_minus_1_ = 766377984,
static kWindowMask = 1048575,
lz77_window_storage_ = std::unique_ptr<unsigned char []> = {
get() = {<No data fields>}}, lz77_window_ = 0x0,
num_decoded_ = 0, num_to_copy_ = 0, copy_pos_ = 0,
lz77_ctx_ = 0, lz77_min_length_ = 0, lz77_threshold_ = 1048576,
lz77_length_uint_ = {split_exponent = 4, split_token = 16,
msb_in_token = 2, lsb_in_token = 0}, special_distances_ = {
4294967266, 0, 0, 0, 766377984, 573, 2832632230, 32766,
854985296, 573, 0, 0, 854985296, 573, 0, 0, 766377985, 573,
854985296, 573, 1073741922, 0, 0, 0, 24896, 0, 1557, 0,
766377984, 573, 2831798869, 32766, 766377984, 573,
1342177635, 0, 766377984, 573, 0, 0, 168, 0, 2, 0, 0, 0, 5,
0, 792974416, 573, 0, 0, 0, 0, 0, 0, 1241776206, 32766, 49,
0, 2771451904, 32766, 752, 0, 1, 0, 2831718519, 32766,
792930224, 573, 2147353477, 0, 2, 0, 2831718950, 32766,
831864980, 32766, 2831718803, 32766, 0, 0, 80, 0, 792930128,
573, 792930176, 573, 1, 0, 9, 0, 1240846336, 155, 2281964431,
0, 8192, 0, 100925442, 32758, 766590048, 573, 2831719167,
32766, 792930112, 573, 1241776206, 0, 0, 0, 0, 0, 49, 0,
766377984, 573, 1342177379, 0, 2831737513, 32766},
num_special_distances_ = 766378728}}, readers = 0x9b4b9ffb20,
num_passes = 1, ctx_offset = {0, 32, 24, 1, 140731692403680, 2,
140731730211917, 2461782638592, 140730240598371, 1073741920, 0},
nzeros_stride = 64, row_nzeros = {{0x23d340efe00, 0x23d340f2a80,
0x23d32f4e300}, {0x2b1,
0x7ffea8c9b44d <ntdll!RtlAllocateHeap+2733>, 0x23d2dae0000}, {
0x40000062, 0x40000060, 0x0}, {0x6150, 0x6140, 0x1}, {
0x23d2dae0000, 0x615,
0x7ffea8c9b44d <ntdll!RtlAllocateHeap+2733>}, {0x23d2dae0000,
0x40000062, 0x6140}, {0x6150, 0x0, 0x9b4b9ff7b4}, {0x400000018,
0x0, 0x20}, {0x1, 0x23d2dae0000, 0x0}, {0x23d2dae0000,
0x7ffea8d689a6 <ntdll!RtlRegisterSecureMemoryCacheCallback+4198>, 0x23d2f432750}, {0x0, 0x1ff0, 0x0}}, row_nzeros_top = {{0x0, 0x0, 0x0}, {
0x2b00, 0x4, 0x7ffea87c9d40 <msvcrt!malloc+112>}, {0x0, 0x2b00,
0x23d306c5680}, {0x9b4b9ff940, 0x9b4b9ff940, 0x3}, {0x6140,
0x6000, 0x3}, {0x7ffea87c9d40 <msvcrt!malloc+112>, 0x0,
0x6140}, {0x9c,
0x7ffe1f5e0000 <jxl::UnpredictICC(unsigned char const*, unsigned long long, jxl::PaddedBytes*)+4784>, 0x23d306c5680}, {
0x7ffe1f611bf8 <hwy::AllocateAlignedBytes(unsigned long long, void* (*)(void*, unsigned long long), void*)+152>, 0x40, 0x6000}, {0x40000,
0x23d306c5620, 0x23d306c5620}, {0x40000, 0x23d306c5620,
0x7ffe1f624f6d <jxl::GroupDecCache::InitOnce(unsigned long long, unsigned long long)+733>}, {0x0, 0x0, 0x0}}, group_dec_cache = 0x23d306c5620,
block_ctx_map = 0x23d2f43a848, qf = 0x23d2f43a608,
quant_dc = 0x23d2f43a7c0, qf_row = 0x23d30660800,
quant_dc_row = 0x23d3067e0e0 "", rect = {x0_ = 96, y0_ = 0,
xsize_ = 32, ysize_ = 32}, hshift = {0, 0, 0}, vshift = {0, 0, 0}}
#2 0x00007ffe1f591c5b in jxl::FrameDecoder::ProcessACGroup (
this=0x23d2f441200, ac_group_id=ac_group_id@entry=3,
br=br@entry=0x9b4b9ffb20, num_passes=1, thread=thread@entry=7,
force_draw=force_draw@entry=false, dc_only=dc_only@entry=false)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_frame.cc:625
jxl_return_if_error_status = <optimized out>
gx = <optimized out>
gy = <optimized out>
x = 768
y = 0
mrect = {x0_ = 2461809183448, y0_ = 140731655792707,
xsize_ = 1073741920, ysize_ = 0}
#3 0x00007ffe1f591d9c in operator() (thread=<optimized out>, g=3,
__closure=0x9b4a1fdca0)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_frame.cc:790
first_pass = 0
readers = {0x23d2f43d710, 0x0, 0x7ffea45a27e0, 0x9b4b9ffb10, 0x0,
0x7ffea68a251d <SetEvent+13>, 0x23d2f42bbb0, 0x23d2f42bbe0, 0x7,
0x23d2f42bbd8, 0x6}
has_error = @0x9b4a1fdc17: {_M_base = {static _S_alignment = 1,
_M_i = false}}
section_status = @0x9b4a1fdd48: 0x23d2f43d830
sections = @0x9b4a1fdd38: 0x23d2f441810
num_ac_passes = std::vector of length 16, capacity 16 = {1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
ac_group_sec = std::vector of length 16, capacity 16 = {
std::vector of length 1, capacity 1 = {3},
std::vector of length 1, capacity 1 = {4},
std::vector of length 1, capacity 1 = {5},
std::vector of length 1, capacity 1 = {6},
std::vector of length 1, capacity 1 = {7},
std::vector of length 1, capacity 1 = {8},
std::vector of length 1, capacity 1 = {9},
std::vector of length 1, capacity 1 = {10},
std::vector of length 1, capacity 1 = {11},
std::vector of length 1, capacity 1 = {12},
std::vector of length 1, capacity 1 = {13},
std::vector of length 1, capacity 1 = {14},
std::vector of length 1, capacity 1 = {15},
std::vector of length 1, capacity 1 = {16},
std::vector of length 1, capacity 1 = {17},
std::vector of length 1, capacity 1 = {18}}
this = 0x23d2f441200
num = @0x9b4a1fdd40: 19
has_error = <optimized out>
section_status = <optimized out>
sections = <optimized out>
num = <optimized out>
num_ac_passes = <optimized out>
ac_group_sec = <optimized out>
this = <optimized out>
first_pass = <optimized out>
readers = <optimized out>
i = <optimized out>
i = <optimized out>
#4 jxl::ThreadPool::RunCallState<jxl::FrameDecoder::ProcessSections(const jxl::FrameDecoder::SectionInfo*, size_t, jxl::FrameDecoder::SectionStatus*)::<lambda(size_t)>, jxl::FrameDecoder::ProcessSections(const jxl::FrameDecoder::SectionInfo*, size_t, jxl::FrameDecoder::SectionStatus*)::<lambda(size_t, size_t)> >::CallDataFunc(void *, uint32_t, size_t) (jpegxl_opaque=<optimized out>,
value=3, thread_id=<optimized out>)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/base/data_parallel.h:88
self = <optimized out>
#5 0x00007ffe7e43146a in jpegxl::(anonymous namespace)::ResizeableParallelRunner::DequeueTasks (thread_id=<optimized out>, this=<optimized out>)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/threads/resizable_parallel_runner.cc:119
task = <optimized out>
#6 jpegxl::(anonymous namespace)::ResizeableParallelRunner::WorkerBody (
worker_id=6, this=0x23d2f42bbb0)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/threads/resizable_parallel_runner.cc:103
No locals.
#7 operator() (__closure=<optimized out>)
at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/threads/resizable_parallel_runner.cc:33
i = <optimized out>
this = <optimized out>
i = <optimized out>
this = <optimized out>
#8 std::__invoke_impl<void, jpegxl::(anonymous namespace)::ResizeableParallelRunner::SetNumThreads(size_t)::<lambda()> > (__f=...)
at C:/Documents/msys2/mingw64/include/c++/11.2.0/bits/invoke.h:61
No locals.
#9 std::__invoke<jpegxl::(anonymous namespace)::ResizeableParallelRunner::SetNumThreads(size_t)::<lambda()> > (__fn=...)
at C:/Documents/msys2/mingw64/include/c++/11.2.0/bits/invoke.h:96
No locals.
#10 std::thread::_Invoker<std::tuple<jpegxl::(anonymous namespace)::ResizeableParallelRunner::SetNumThreads(size_t)::<lambda()> > >::_M_invoke<0> (
this=<optimized out>)
at C:/Documents/msys2/mingw64/include/c++/11.2.0/bits/std_thread.h:253
No locals.
#11 std::thread::_Invoker<std::tuple<jpegxl::(anonymous namespace)::ResizeableParallelRunner::SetNumThreads(size_t)::<lambda()> > >::operator() (
this=<optimized out>)
at C:/Documents/msys2/mingw64/include/c++/11.2.0/bits/std_thread.h:260
No locals.
#12 std::thread::_State_impl<std::thread::_Invoker<std::tuple<jpegxl::(anonymous namespace)::ResizeableParallelRunner::SetNumThreads(size_t)::<lambda()> > > >::_M_run(void) (this=<optimized out>)
at C:/Documents/msys2/mingw64/include/c++/11.2.0/bits/std_thread.h:211
No locals.
#13 0x00007ffe724a1371 in ?? ()
from C:\Documents\msys2\mingw64\bin\libstdc++-6.dll
No symbol table info available.
#14 0x00007ffea45a4d53 in ?? ()
from C:\Documents\msys2\mingw64\bin\libwinpthread-1.dll
No symbol table info available.
#15 0x00007ffea87eaf5a in msvcrt!_beginthreadex ()
from C:\WINDOWS\System32\msvcrt.dll
No symbol table info available.
#16 0x00007ffea87eb02c in msvcrt!_endthreadex ()
from C:\WINDOWS\System32\msvcrt.dll
No symbol table info available.
#17 0x00007ffea7447034 in KERNEL32!BaseThreadInitThunk ()
from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#18 0x00007ffea8cc2651 in ntdll!RtlUserThreadStart ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#19 0x0000000000000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
``` | MSYS2 + mingw-w64: segfault when running alpha_premultiplied/input.jxl conformance test | https://api.github.com/repos/libjxl/libjxl/issues/901/comments | 3 | 2021-11-23T20:15:42Z | 2021-12-17T05:41:09Z | https://github.com/libjxl/libjxl/issues/901 | 1,061,671,834 | 901 |
[
"libjxl",
"libjxl"
] | Photon noise is nice but it doesn't fit everywhere. For example, digital artworks might use more "consistent" noise with regards to brightness. If you try to compensate for the loss (due to compression) of such noise by adding back photon_noise, it will change the noise characteristics and deviate (unnecessarily) from the original.
It would thus be nice if we could have a triangular PDF noise as alternative for these use-cases, especially since it should be easy to implement such a simple PDF. | Triangular PDF Noise (as alternative to photon noise) | https://api.github.com/repos/libjxl/libjxl/issues/900/comments | 3 | 2021-11-23T16:08:12Z | 2022-04-07T08:01:55Z | https://github.com/libjxl/libjxl/issues/900 | 1,061,463,867 | 900 |
[
"libjxl",
"libjxl"
] | gdk-pixbuf plugin will currently install in a wrong path when cross-compiling because `pkg_get_variable(GDK_PIXBUF_MODULEDIR gdk-pixbuf-2.0 gdk_pixbuf_moduledir)` will unfortunately return the absolute path on the build machine.
See [this idea](https://github.com/AOMediaCodec/libavif/blob/a50928936b068896bac6a1eb6c251089c6079a0c/contrib/gdk-pixbuf/CMakeLists.txt#L24) and [this idea](https://github.com/strukturag/libheif/blob/561abfc6b8c014499d42df5246cf2f6510fc196f/gdk-pixbuf/CMakeLists.txt#L7) for potential fixes. | Wrong install path for gdk-pixbuf plugin | https://api.github.com/repos/libjxl/libjxl/issues/899/comments | 1 | 2021-11-23T15:26:47Z | 2021-12-23T14:50:51Z | https://github.com/libjxl/libjxl/issues/899 | 1,061,417,681 | 899 |
[
"libjxl",
"libjxl"
] | Currently when disabling coalescing and using the pixel callback function, it still returns image-sized frames. This is probably not what we want in that case; it should return a frame-sized frame instead, like it does with the buffer methods. That or we should just not allow using that combination (for now). | No-coalescing + pixel callback = ? | https://api.github.com/repos/libjxl/libjxl/issues/896/comments | 2 | 2021-11-22T20:56:29Z | 2024-03-04T10:12:34Z | https://github.com/libjxl/libjxl/issues/896 | 1,060,584,915 | 896 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Most of the images from this one camera transcoded successfully with jbrd, but a few failed:
```
$ cjxl IMG_0005.JPG - > /dev/null
JPEG XL encoder v0.7.0 cacc3da [AVX2]
Read 4608x3456 image, 144.1 MP/s
Encoding [Container | JPEG, lossless transcode, tortoise | JPEG reconstruction data | 6721-byte Exif], 16 threads.
Compressed to 4351247 bytes (2.186 bpp).
4608 x 3456, 54.37 MP/s [54.37, 54.37], 1 reps, 16 threads
./lib/jxl/fields.cc:730: JXL_FAILURE: No feasible selector for 149279
./lib/jxl/fields.cc:488: JXL_RETURN_IF_ERROR code=1: ok_
./lib/jxl/fields.cc:633: JXL_RETURN_IF_ERROR code=1: CanEncode(fields, &extension_bits, &total_bits)
./lib/jxl/jpeg/enc_jpeg_data.cc:235: JXL_RETURN_IF_ERROR code=1: Bundle::Write(jpeg_data, &writer, 0, nullptr)
Warning: failed to create JPEG reconstruction data
Including container: 4358020 bytes (2.189 bpp).
```
The error message is similar to #803, and the metadata is the cause, but the tail data is quite small, well below 4 MB so maybe it's a different problem?
**Expected behavior**
Ideally, jbrd would be created, but I don't know if that's actually possible.
**Screenshots**
The image:

**Environment**
- OS: Arch Linux
- Compiler version: clang 13.0.0
- CPU type: x86_64, ryzen 2700x
- cjxl/djxl version string: cacc3da | Feature request: allow `jbrd` to reconstruct a part of the file when it's not possible for the whole file | https://api.github.com/repos/libjxl/libjxl/issues/895/comments | 7 | 2021-11-22T19:58:33Z | 2025-01-17T18:12:55Z | https://github.com/libjxl/libjxl/issues/895 | 1,060,539,161 | 895 |
[
"libjxl",
"libjxl"
] | Hi, sorry for interrupting the development, I'm having trouble using the C/C++ API to encode an RGB pixel array losslessly.
The image generated by the function below is not lossless unfortunately, I was wondering if I'm simply missing something, I thought that only `JxlEncoderOptionsSetLossless()` was needed but that might not be the case.
My code is based on this example: `examples/encode_oneshot.cc`, I also used `lib/include/jxl/encode.h` and `tools/cjxl.cc` as references.
```cpp
// Format -> superclass with attributes such as width, height, file size...
std::shared_ptr<Format> encode(const std::vector<uint8_t>& rgb_pixels,
const int width,
const int height) {
auto encoder = JxlEncoderMake(/*memory_manager=*/nullptr);
auto runner = JxlThreadParallelRunnerMake(
/*memory_manager=*/nullptr, JxlThreadParallelRunnerDefaultNumWorkerThreads());
if (JXL_ENC_SUCCESS != JxlEncoderSetParallelRunner(
encoder.get(), JxlThreadParallelRunner, runner.get())) {
std::cerr << "LibJXL: JxlEncoderSetParallelRunner() failed." << std::endl;
return nullptr;
}
JxlBasicInfo basic_info;
JxlEncoderInitBasicInfo(&basic_info);
basic_info.xsize = width;
basic_info.ysize = height;
if (JXL_ENC_SUCCESS != JxlEncoderSetBasicInfo(encoder.get(), &basic_info)) {
std::cerr << "LibJXL: JxlEncoderSetBasicInfo() failed." << std::endl;
return nullptr;
}
JxlEncoderOptions* options = JxlEncoderOptionsCreate(encoder.get(), nullptr);
if (JXL_ENC_SUCCESS != JxlEncoderOptionsSetLossless(options, true)) {
std::cerr << "LibJXL: JxlEncoderOptionsSetLossless() failed." << std::endl;
return nullptr;
}
JxlPixelFormat jxl_pixel_format = {3, JXL_TYPE_UINT8, JXL_NATIVE_ENDIAN, 0};
JxlColorEncoding color_encoding = {};
JxlColorEncodingSetToSRGB(&color_encoding,
/*is_gray=*/jxl_pixel_format.num_channels < 3);
if (JXL_ENC_SUCCESS != JxlEncoderSetColorEncoding(encoder.get(), &color_encoding)) {
std::cerr << "LibJXL: JxlEncoderSetColorEncoding() failed." << std::endl;
return nullptr;
}
if (JXL_ENC_SUCCESS != JxlEncoderAddImageFrame(options, &jxl_pixel_format,
(void*)rgb_pixels.data(),
rgb_pixels.size())) {
std::cerr << "LibJXL: JxlEncoderAddImageFrame() failed." << std::endl;
return nullptr;
}
std::vector<uint8_t> jxl_buffer;
jxl_buffer.resize(64);
uint8_t* next_out = jxl_buffer.data();
size_t avail_out = jxl_buffer.size() - (next_out - jxl_buffer.data());
JxlEncoderStatus process_result = JXL_ENC_NEED_MORE_OUTPUT;
while (process_result == JXL_ENC_NEED_MORE_OUTPUT) {
process_result = JxlEncoderProcessOutput(encoder.get(), &next_out, &avail_out);
if (process_result == JXL_ENC_NEED_MORE_OUTPUT) {
size_t offset = next_out - jxl_buffer.data();
jxl_buffer.resize(jxl_buffer.size() * 2);
next_out = jxl_buffer.data() + offset;
avail_out = jxl_buffer.size() - offset;
}
}
jxl_buffer.resize(next_out - jxl_buffer.data());
if (JXL_ENC_SUCCESS != process_result) {
std::cerr << "LibJXL: JxlEncoderProcessOutput() failed." << std::endl;
return nullptr;
}
// JXL -> Format subsclass
auto jxl = std::make_shared<JXL>(jxl_buffer, width, height);
return jxl;
}
``` | Difficulties with lossless encoding | https://api.github.com/repos/libjxl/libjxl/issues/894/comments | 6 | 2021-11-22T18:43:12Z | 2022-03-23T08:03:41Z | https://github.com/libjxl/libjxl/issues/894 | 1,060,480,707 | 894 |
[
"libjxl",
"libjxl"
] | Hello,
this is a new warning which appeared recently:
```
* QA Notice: Package triggers severe warnings which indicate that it
* may exhibit random runtime failures.
* /usr/include/bits/string_fortified.h:59:33: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ offset [0, 3] is out of the bounds [0, 0] [-Warray-bounds]
* Please do not file a Gentoo bug and instead report the above QA
* issues directly to the upstream developers of this software.
* Homepage: https://github.com/libjxl/libjxl
```
```
In file included from /usr/include/string.h:519,
from /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/base/padded_bytes.h:13,
from /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/color_management.h:16,
from /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/color_management.cc:12:
In function ‘void* memset(void*, int, size_t)’,
inlined from ‘jxl::Status jxl::MaybeCreateProfile(const jxl::ColorEncoding&, jxl::PaddedBytes*)’ at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/color_management.cc:508:9:
/usr/include/bits/string_fortified.h:59:33: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ offset [0, 3] is out of the bounds [0, 0] [-Warray-bounds]
59 | return __builtin___memset_chk (__dest, __ch, __len,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
60 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
```
| Warning from Gentoo Linux package | https://api.github.com/repos/libjxl/libjxl/issues/892/comments | 2 | 2021-11-22T16:27:42Z | 2024-03-04T10:12:34Z | https://github.com/libjxl/libjxl/issues/892 | 1,060,356,695 | 892 |
[
"libjxl",
"libjxl"
] | ASAN build finishes in 22+ min.
MSAN build finishes in 33+ min.
I'm sure it could be faster. | (A|M)SAN build is very slow in CI | https://api.github.com/repos/libjxl/libjxl/issues/890/comments | 2 | 2021-11-22T14:46:33Z | 2024-03-04T10:38:58Z | https://github.com/libjxl/libjxl/issues/890 | 1,060,243,245 | 890 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Since 10f5c38d2d3737464a3a09b2e73f3674641c760e I cannot build jxl on arm64 with GCC.
Clang compiles fine.
```
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h: In function 'void jxl::N_NEON::{anonymous}::FastTransposeBlock(const int16_t*, size_t, size_t, size_t, int16_t*, size_t)':
/libjxl/lib/jxl/fast_dct-inl.h:61:62: note: use '-flax-vector-conversions' to permit conversions between vectors with differing element types or numbers of subparts
61 | auto four0 = vtrnq_s32(vreinterpretq_s16_s32(a01.val[0]),
| ^
/libjxl/lib/jxl/fast_dct-inl.h:61:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
61 | auto four0 = vtrnq_s32(vreinterpretq_s16_s32(a01.val[0]),
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:62:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
62 | vreinterpretq_s16_s32(a23.val[0]));
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:63:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
63 | auto four1 = vtrnq_s32(vreinterpretq_s16_s32(a01.val[1]),
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:64:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
64 | vreinterpretq_s16_s32(a23.val[1]));
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:74:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
74 | auto four2 = vtrnq_s32(vreinterpretq_s16_s32(a45.val[0]),
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:75:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
75 | vreinterpretq_s16_s32(a67.val[0]));
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:76:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
76 | auto four3 = vtrnq_s32(vreinterpretq_s16_s32(a45.val[1]),
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
In file included from /libjxl/lib/jxl/fast_dct.cc:13:
/libjxl/lib/jxl/fast_dct-inl.h:77:61: error: cannot convert 'int16x8_t' to 'int32x4_t'
77 | vreinterpretq_s16_s32(a67.val[1]));
| ~~~~~~~~~^
| |
| int16x8_t
In file included from /libjxl/third_party/highway/hwy/ops/arm_neon-inl.h:18,
from /libjxl/third_party/highway/hwy/highway.h:303,
from /libjxl/lib/jxl/fast_dct.cc:9:
/usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/include/arm_neon.h:5253:34: note: initializing argument 1 of 'int16x8_t vreinterpretq_s16_s32(int32x4_t)'
5253 | vreinterpretq_s16_s32 (int32x4_t __a)
| ~~~~~~~~~~^~~
[ 72%] Building CXX object lib/CMakeFiles/jxl_dec-obj.dir/jxl/fields.cc.o
make[3]: *** [lib/CMakeFiles/jxl_dec-obj.dir/build.make:594: lib/CMakeFiles/jxl_dec-obj.dir/jxl/fast_dct.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:3707: lib/CMakeFiles/jxl_dec-obj.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:5148: tools/CMakeFiles/cjxl.dir/rule] Error 2
make: *** [Makefile:2038: cjxl] Error 2
```
**To Reproduce**
Steps to reproduce the behavior via Docker on arm64:
```
from alpine:3.14
run apk add git cmake build-base libjpeg-turbo-dev libpng-dev zlib-dev
run git clone https://github.com/libjxl/libjxl.git
workdir /libjxl
run git submodule update --init --recursive
workdir /libjxl/build
run cmake ..
run make -j$(($(nproc) + 1)) cjxl djxl
```
**Environment**
- OS: Alpine 3.14
- Compiler version: GCC 10.3.1
- CPU type: aarch64
```
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Neoverse-N1
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r3p1
BogoMIPS: 50.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-3
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Not affected
Srbds: Not affected
Tsx async abort: Not affected
```
| Build failure on arm64 with GCC | https://api.github.com/repos/libjxl/libjxl/issues/884/comments | 6 | 2021-11-21T22:57:34Z | 2021-11-22T13:35:43Z | https://github.com/libjxl/libjxl/issues/884 | 1,059,510,433 | 884 |
[
"libjxl",
"libjxl"
] | Hello, I notice as of https://github.com/libjxl/libjxl/pull/841 that libjxl has a new security policy.
The [libvips fuzzers](https://github.com/libvips/libvips/tree/master/fuzz) running on OSS Fuzz have found 4 new libjxl-related issues in the last couple of days, including 2 possible CVE-level problems, one of which causes a segfault on decode.
Would someone from the libjxl team like to be added, perhaps temporarily, to the `auto_ccs` list for the libvips OSS Fuzz project?
https://github.com/google/oss-fuzz/blob/master/projects/libvips/project.yaml
This will give you direct access to the issues as they are found, including stack traces and minimised samples. I suspect this approach might be easier than manually emailing files around. | Invitation for one or more libjxl maintainers to (temporarily?) join the libvips OSS Fuzz group | https://api.github.com/repos/libjxl/libjxl/issues/883/comments | 4 | 2021-11-21T22:40:24Z | 2021-11-22T16:37:44Z | https://github.com/libjxl/libjxl/issues/883 | 1,059,506,920 | 883 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
several " may be used uninitialized" and "out of bounds" warnings
**To Reproduce**
compilation
**Expected behavior**
no warning
**Environment**
- OS: Windows 10
- Compiler version: g++ 11.2.0
- CPU type: x86_64
git of today.
Here are the warnings :
```
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/color_management.cc: In function 'jxl::Status jxl::MaybeCreateProfile(const jxl::ColorEncoding&, jxl::PaddedBytes*)':
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/color_management.cc:508:9: warning: 'void* memset(void*, int, size_t)' offset [0, 3] is out of the bounds [0, 0] [-Warray-bounds]
508 | memset(icc_sum.data() + 44, 0, 4);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/color_management.cc:509:9: warning: 'void* memset(void*, int, size_t)' offset [0, 3] is out of the bounds [0, 0] [-Warray-bounds]
509 | memset(icc_sum.data() + 64, 0, 4);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
```
In file included from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/chroma_from_luma.h:23,
from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.h:18,
from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:6:
In member function 'jxl::ANSSymbolReader& jxl::ANSSymbolReader::operator=(jxl::ANSSymbolReader&&)',
inlined from 'jxl::Status jxl::{anonymous}::GetBlockFromBitstream::Init(jxl::BitReader* __restrict__*, size_t, size_t, size_t, const jxl::Rect&, jxl::GroupDecCache*, jxl::PassesDecoderState*, size_t)' at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:613:77,
inlined from 'jxl::Status jxl::DecodeGroup(jxl::BitReader* __restrict__*, size_t, size_t, jxl::PassesDecoderState*, jxl::GroupDecCache*, size_t, jxl::ImageBundle*, size_t, bool, bool)' at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:751:3:
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_ans.h:151:7: warning: '<anonymous>.jxl::ANSSymbolReader::num_special_distances_' may be used uninitialized [-Wmaybe-uninitialized]
151 | class ANSSymbolReader {
| ^~~~~~~~~~~~~~~
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc: In function 'jxl::Status jxl::DecodeGroup(jxl::BitReader* __restrict__*, size_t, size_t, jxl::PassesDecoderState*, jxl::GroupDecCache*, size_t, jxl::ImageBundle*, size_t, bool, bool)':
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:613:77: note: '<anonymous>' declared here
613 | ANSSymbolReader(&dec_state->code[pass + first_pass], readers[pass]);
| ^
In file included from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/chroma_from_luma.h:23,
from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.h:18,
from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:6:
In member function 'jxl::ANSSymbolReader& jxl::ANSSymbolReader::operator=(jxl::ANSSymbolReader&&)',
inlined from 'jxl::Status jxl::{anonymous}::GetBlockFromBitstream::Init(jxl::BitReader* __restrict__*, size_t, size_t, size_t, const jxl::Rect&, jxl::GroupDecCache*, jxl::PassesDecoderState*, size_t)' at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:613:77,
inlined from 'jxl::Status jxl::DecodeGroup(jxl::BitReader* __restrict__*, size_t, size_t, jxl::PassesDecoderState*, jxl::GroupDecCache*, size_t, jxl::ImageBundle*, size_t, bool, bool)' at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:751:3:
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_ans.h:151:7: warning: '*(unsigned char (*)[480])((char*)&<unnamed> + offsetof(jxl::ANSSymbolReader, jxl::ANSSymbolReader::special_distances_[0]))' may be used uninitialized [-Wmaybe-uninitialized]
151 | class ANSSymbolReader {
| ^~~~~~~~~~~~~~~
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc: In function 'jxl::Status jxl::DecodeGroup(jxl::BitReader* __restrict__*, size_t, size_t, jxl::PassesDecoderState*, jxl::GroupDecCache*, size_t, jxl::ImageBundle*, size_t, bool, bool)':
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_group.cc:613:77: note: '<anonymous>' declared here
613 | ANSSymbolReader(&dec_state->code[pass + first_pass], readers[pass]);
| ^
```
```
In file included from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/icc_codec.h:19,
from C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/icc_codec.cc:6:
In member function 'jxl::ANSSymbolReader& jxl::ANSSymbolReader::operator=(jxl::ANSSymbolReader&&)',
inlined from 'jxl::Status jxl::ICCReader::_ZN3jxl9ICCReader4InitEPNS_9BitReaderEy.part.0(jxl::BitReader*, size_t)' at C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/icc_codec.cc:319:49:
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/dec_ans.h:151:7: warning: '<anonymous>.jxl::ANSSymbolReader::num_special_distances_' may be used uninitialized [-Wmaybe-uninitialized]
151 | class ANSSymbolReader {
| ^~~~~~~~~~~~~~~
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/icc_codec.cc: In member function 'jxl::Status jxl::ICCReader::_ZN3jxl9ICCReader4InitEPNS_9BitReaderEy.part.0(jxl::BitReader*, size_t)':
C:/Documents/msys2/home/vincent.torri/gitroot_64/libjxl_main/lib/jxl/icc_codec.cc:319:49: note: '<anonymous>' declared here
319 | ans_reader_ = ANSSymbolReader(&code_, reader);
| ^
```
| Warnings on Windows with MSYS2 + mingw-w64 | https://api.github.com/repos/libjxl/libjxl/issues/882/comments | 7 | 2021-11-21T16:12:51Z | 2024-03-04T10:12:34Z | https://github.com/libjxl/libjxl/issues/882 | 1,059,419,451 | 882 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
```
./deps.sh: line 26: ${path^^}: bad substitution
```
**To Reproduce**
```
run ./deps.sh on macOS terminal
make sure you don't install another lastest version bash
beacuse macOS pre-installed a very old bash version (3.2)
```
**Expected behavior**
```
no error.
```
**Screenshots**
**Environment**
- OS: macOS
- Compiler version: clang 12
- CPU type: x86_64
- cjxl/djxl version string: https://github.com/libjxl/libjxl/archive/v0.6.1.tar.gz
**Additional context**
```
macOS pre-installed bash version is 3.2, it is a very old version, `${path^^}` feature is introduced in bash4.
``` | ./deps.sh: line 26: ${path^^}: bad substitution on macos | https://api.github.com/repos/libjxl/libjxl/issues/881/comments | 1 | 2021-11-21T07:28:33Z | 2025-02-04T18:41:53Z | https://github.com/libjxl/libjxl/issues/881 | 1,059,311,899 | 881 |
[
"libjxl",
"libjxl"
] | I wanted to view a JXL file on Windows and i tried to compile the embedded viewer, when i realized that it was using QT. I don't want to install QT just for that.
So my request is : would it be possible to add a basic viewer (or replace this one) with one which depends on GDI on Windows, and Xlib (or XCB) otherwise ?
| [request] use X11 and GDI for a basic viewer instead of QT | https://api.github.com/repos/libjxl/libjxl/issues/880/comments | 2 | 2021-11-20T20:57:44Z | 2021-11-21T13:40:18Z | https://github.com/libjxl/libjxl/issues/880 | 1,059,228,245 | 880 |
[
"libjxl",
"libjxl"
] | /lib/jxl/dec_patch_dictionary.cc line 117
code:
for (size_t i = 0; i < id_count; i++) {
PatchPosition pos;
pos.ref_pos = ref_pos;
// .. some lines
for (size_t i = 0; i < shared_->metadata->m.extra_channel_info.size() + 1; // <-- shadow variable
i++) {
| shadow variable | https://api.github.com/repos/libjxl/libjxl/issues/877/comments | 1 | 2021-11-20T10:55:22Z | 2021-11-22T10:17:41Z | https://github.com/libjxl/libjxl/issues/877 | 1,059,118,613 | 877 |
[
"libjxl",
"libjxl"
] | It would be nice to have a `jxltran` tool similar to `jpegtran` that can perform some operations on existing jxl images that don't involve decoding / encoding, but things like changing some header fields, stripping or adding metadata, etc.
Perhaps some of that functionality is already or should be exposed through the API, and can be implemented that way, e.g. anything related to box handling. For changing codestream header fields, it might be trickier to do that via the API (we would need new concepts in the API for that), but it would still be useful to have a way to do that.
Examples of useful codestream level functionality:
- change the orientation
- change the intrinsic dimensions
- do a reversible crop (i.e. change the image dimensions while keeping frames intact, only updating their crop size and offset)
- add, remove, or change the photon noise
- sharpen or blur the image by adjusting its gaborish weights
- change the nominal color space / bit depth (in case of XYB encoded images)
- extract the ICC profile
- extract keyframes from an animation
- get or set the names of frames and extra channels
- change the FPS and/or duration of individual frames
Examples of useful file format level functionality:
- get, set or strip exif/xmp metadata
- strip the jbrd box
- compress or decompress exif/xmp to/from brob boxes
- convert between naked codestream and container
Most of the codestream level functionality is probably somewhat tricky to implement and is likely something we don't really want to expose in the API since it involves too much of the "guts" of jxl. However, the things that involve only the _image_ header (not the frame headers) seem like they shouldn't be too hard to do, and it might be worthwhile to have API functions to update those fields (maybe not for 1.0 though). I'm thinking in particular about orientation, intrinsic dimensions, and animation speed (FPS). In particular, for feature parity with the existing approach for orientation (doing it via Exif, with many 'viewers' actually implementing a way for users to change orientation too), I think it would be good to have a way in the API to do that.
| New tool request: jxltran | https://api.github.com/repos/libjxl/libjxl/issues/871/comments | 6 | 2021-11-19T14:26:01Z | 2025-04-14T14:45:22Z | https://github.com/libjxl/libjxl/issues/871 | 1,058,587,608 | 871 |
[
"libjxl",
"libjxl"
] | hello
I would like to know your opinion of this proposal : JxlAnimationHeader structure could have the number of frames, and, if the animation is repeated infinitely, having a bool for this (infinite : true/false)
thank you | modify JxlAnimationHeader | https://api.github.com/repos/libjxl/libjxl/issues/869/comments | 6 | 2021-11-18T19:13:41Z | 2021-11-19T09:59:04Z | https://github.com/libjxl/libjxl/issues/869 | 1,057,708,513 | 869 |
[
"libjxl",
"libjxl"
] | afaics, the gdkpixbuf plugin is explicitely calling skcms_Parse()
wouldn't there be a compiler error if lcms2 is used instead of skcms ?
| gdkpixbuf plugin calls explicitely skcms_Parse(), what if lcms2 is used ? | https://api.github.com/repos/libjxl/libjxl/issues/865/comments | 2 | 2021-11-18T07:33:17Z | 2021-11-23T10:27:12Z | https://github.com/libjxl/libjxl/issues/865 | 1,057,030,464 | 865 |
[
"libjxl",
"libjxl"
] | SetBlobsFromJpegData reads exif and xmp. it is called via DecodeImageJPGCoefficients -> jpeg::DecodeImageJPG. in jxl::extras::DecodeImageJPG, exif is read by ReadExif. i guess there should be ReadXMP similar to ReadExif. it seems like a lot of code duplication though. | cjxl ignores JPEG XMP if JPEG reconstruction is disabled | https://api.github.com/repos/libjxl/libjxl/issues/861/comments | 2 | 2021-11-16T18:33:28Z | 2024-09-15T16:14:05Z | https://github.com/libjxl/libjxl/issues/861 | 1,055,198,575 | 861 |
[
"libjxl",
"libjxl"
] | afaics, fclose() / JxlDecoderCloseInput() are not called in jxlinfo.c example, is it normal ?
| fclose() / JxlDecoderCloseInput() not called in the jxlinfo.c example | https://api.github.com/repos/libjxl/libjxl/issues/859/comments | 1 | 2021-11-16T15:26:23Z | 2021-11-17T17:19:35Z | https://github.com/libjxl/libjxl/issues/859 | 1,055,011,979 | 859 |
[
"libjxl",
"libjxl"
] | The following command seems to hang forever:
```
[43/181] /usr/local/bin/clang++ -DJPEGXL_MAJOR_VERSION=0 -DJPEGXL_MINOR_VERSION=7 -DJPEGXL_PATCH_VERSION=0 -DJXL_ENABLE_FUZZERS -DJXL_INTERNAL_LIBRARY_BUILD -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -I/src/libjxl -I/src/libjxl/lib/include -I/src/libjxl/third_party/highway -I/src/libjxl/third_party/brotli/c/include -I/src/libjxl/third_party/skcms -I/work/libjxl-corpus/lib/include -funwind-tables -Xclang -mrelax-all -Xclang -mconstructor-aliases -fno-omit-frame-pointer -O3 -DNDEBUG -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fmacro-prefix-map=/src/libjxl=. -Wno-builtin-macro-redefined -Wall -fmerge-all-constants -fno-builtin-fwrite -fno-builtin-fread -Wextra -Wc++11-compat -Warray-bounds -Wformat-security -Wimplicit-fallthrough -Wno-register -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wvla -Wdeprecated-increment-bool -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wliteral-conversion -Wno-c++98-compat -Wno-unused-command-line-argument -Wprivate-header -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -Wunreachable-code -Wunused-comparison -fsized-deallocation -fno-exceptions -fmath-errno -fnew-alignment=8 -fno-cxx-exceptions -fno-slp-vectorize -fno-vectorize -disable-free -disable-llvm-verifier -DJPEGXL_ENABLE_SKCMS=1 -DJPEGXL_BUNDLE_SKCMS=1 -std=c++11 -MD -MT lib/CMakeFiles/jxl_enc-obj.dir/jxl/enc_ac_strategy.cc.o -MF lib/CMakeFiles/jxl_enc-obj.dir/jxl/enc_ac_strategy.cc.o.d -o lib/CMakeFiles/jxl_enc-obj.dir/jxl/enc_ac_strategy.cc.o -c /src/libjxl/lib/jxl/enc_ac_strategy.cc
```
Likely it has started after updating HWY (will check soon). | Fuzzer build fails (timeout) | https://api.github.com/repos/libjxl/libjxl/issues/858/comments | 14 | 2021-11-16T15:07:06Z | 2024-03-04T10:37:16Z | https://github.com/libjxl/libjxl/issues/858 | 1,054,989,429 | 858 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
`djxl` failed to decompress to pixels.
**To Reproduce**
Take the image *sample_5184×3456.jpeg* from [here](https://filesamples.com/formats/jpeg).
Encode the image with settings: `cjxl -j -d 0.5 -e 8` (must be `-d ≤ 0.9` and `-e ≥ 8`).
Try to decode with `djxl`.
```PowerShell
PS > cjxl 0.jpg 1.jxl -j -d 0.5 -e 8
JPEG XL encoder v0.7.0 10f5c38 [SSE4]
Read 5184x3456 image, 104.3 MP/s
Encoding [VarDCT, d0.500, kitten], 4 threads.
Compressed to 5494140 bytes (2.453 bpp).
5184 x 3456, 0.51 MP/s [0.51, 0.51], 1 reps, 4 threads.
PS > djxl 1.jxl 2.png
JPEG XL decoder v0.7.0 10f5c38 [SSE4]
Read 5494140 compressed bytes.
Failed to decompress to pixels.
```
**Expected behavior**
The image must be successfully decoded.
**Environment**
- OS: Windows 11
- Compiler version: clang 13
- CPU type: x86_64, i5 3570k, 16 GiB ram
- cjxl/djxl version string: v0.7.0 10f5c38 [SSE4]
**Additional context**
F.e. `-d 1` and `-e 7`:
```PowerShell
PS > cjxl 0.jpg 1.jxl -j -d 1 -e 7
JPEG XL encoder v0.7.0 10f5c38 [SSE4]
Read 5184x3456 image, 104.3 MP/s
Encoding [VarDCT, d1.000, squirrel], 4 threads.
Compressed to 4302140 bytes (1.921 bpp).
5184 x 3456, 9.02 MP/s [9.02, 9.02], 1 reps, 4 threads.
PS > djxl 1.jxl 2.png
JPEG XL decoder v0.7.0 10f5c38 [SSE4]
Read 4302140 compressed bytes.
Decoded to pixels.
5184 x 3456, 70.86 MP/s [70.86, 70.86], 1 reps, 4 threads.
Allocations: 401 (max bytes in use: 5.256780E+08)
```
| `djxl` failed with "Tree is too large" | https://api.github.com/repos/libjxl/libjxl/issues/848/comments | 3 | 2021-11-15T08:38:52Z | 2021-11-19T11:17:55Z | https://github.com/libjxl/libjxl/issues/848 | 1,053,360,946 | 848 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
This 49 byte input file (found by fuzzing) [crash-min.jxl.txt](https://github.com/libjxl/libjxl/files/7520009/crash-min.jxl.txt) causes a segmentation fault when trying to decode with djxl.
**To Reproduce**
`djxl crash-min.jxl.txt --allow_partial_files --allow_more_progressive_steps`
```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==8608==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f3a0f4cb3c8 bp 0x7f3a0967e7b0 sp 0x7f3a0967df38 T7)
==8608==The signal is caused by a READ memory access.
==8608==Hint: address points to the zero page.
#0 0x7f3a0f4cb3c7 (/lib/x86_64-linux-gnu/libc.so.6+0xbb3c7)
#1 0x4ddf5d in __asan_memcpy (/home/ubuntu/libjxl/build/tools/djxl+0x4ddf5d)
#2 0x65c4e0 in jxl::FinalizeImageRect(jxl::Image3<float>*, jxl::Rect const&, std::vector<std::pair<jxl::Plane<float>*, jxl::Rect>, std::allocator<std::pair<jxl::Plane<float>*, jxl::Rect> > > const&, jxl::PassesDecoderState*, unsigned long, jxl::ImageBundle*, jxl::Rect const&) /home/ubuntu/libjxl/lib/jxl/dec_reconstruct.cc:1018:11
#3 0x6693fd in jxl::FinalizeFrameDecoding(jxl::ImageBundle*, jxl::PassesDecoderState*, jxl::ThreadPool*, bool, bool, bool)::$_2::operator()(unsigned long, unsigned long) const /home/ubuntu/libjxl/lib/jxl/dec_reconstruct.cc:1190:12
#4 0x6693fd in jxl::ThreadPool::RunCallState<jxl::FinalizeFrameDecoding(jxl::ImageBundle*, jxl::PassesDecoderState*, jxl::ThreadPool*, bool, bool, bool)::$_1, jxl::FinalizeFrameDecoding(jxl::ImageBundle*, jxl::PassesDecoderState*, jxl::ThreadPool*, bool, bool, bool)::$_2>::CallDataFunc(void*, unsigned int, unsigned long) /home/ubuntu/libjxl/lib/jxl/base/data_parallel.h:88
#5 0x9505a3 in jpegxl::ThreadParallelRunner::RunRange(jpegxl::ThreadParallelRunner*, unsigned long, int) /home/ubuntu/libjxl/lib/threads/thread_parallel_runner_internal.cc:139:7
#6 0x9505a3 in jpegxl::ThreadParallelRunner::ThreadFunc(jpegxl::ThreadParallelRunner*, int) /home/ubuntu/libjxl/lib/threads/thread_parallel_runner_internal.cc:169
#7 0x7f3a102ad6de (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd6de)
#8 0x4ed11e in __asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*) (/home/ubuntu/libjxl/build/tools/djxl+0x4ed11e)
#9 0x7f3a105876da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#10 0x7f3a0f53171e in clone (/lib/x86_64-linux-gnu/libc.so.6+0x12171e)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0xbb3c7)
Thread T7 created by T0 here:
#0 0x4386c0 in pthread_create (/home/ubuntu/libjxl/build/tools/djxl+0x4386c0)
#1 0x7f3a102ad994 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xbd994)
#2 0x51e125 in jxl::ThreadPoolInternal::ThreadPoolInternal(int) /home/ubuntu/libjxl/lib/jxl/base/thread_pool_internal.h:33:9
#3 0x51e125 in jpegxl::tools::(anonymous namespace)::DecompressMain(int, char const**) /home/ubuntu/libjxl/tools/djxl_main.cc:91
#4 0x51e125 in main /home/ubuntu/libjxl/tools/djxl_main.cc:197
#5 0x7f3a0f431bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
==8608==ABORTING
```
**Expected behavior**
The decoder should produce an error message without segmentation fault.
**Environment**
- OS: Ubuntu 18.04 (Windows Subsystem for Linux)
- Compiler version: clang 6.0
- CPU type: x86_64
- cjxl/djxl version string: JPEG XL decoder v0.7.0 6692183 asan [Scalar]
**Additional context**
The file was found using fuzzing (AFL++) and the `--allow_partial_files --allow_more_progressive_steps` flags.
| Potential null pointer dereference in FinalizeImageRect - ASan | https://api.github.com/repos/libjxl/libjxl/issues/842/comments | 1 | 2021-11-11T11:28:28Z | 2021-11-16T09:18:20Z | https://github.com/libjxl/libjxl/issues/842 | 1,050,878,975 | 842 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
When djxl is compiled with MSan it produces a stack trace when provided with any input file that is then converted to an output file:
```
==1828==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x4aaae7 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose() /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/basic_string.h:220:6
#1 0x4aaae7 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/basic_string.h:647
#2 0x4aaae7 in jpegxl::tools::DecompressArgs::ValidateArgs(jpegxl::tools::CommandLineParser const&) /home/ubuntu/libjxl/tools/djxl.cc:166
#3 0x49cca1 in main /home/ubuntu/libjxl/tools/djxl_main.cc:62:13
#4 0x7f7d00231bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
#5 0x41ffa9 in _start (/home/ubuntu/libjxl/build/tools/djxl+0x41ffa9)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/basic_string.h:220:6 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()
```
**To Reproduce**
Just run djxl with any input file (even just a file containing "test") and output file.
`djxl test /tmp/test.jpg`
**Expected behavior**
djxl should not make use of an uninitialized value
**Environment**
- OS: Ubuntu 18.04 (Windows Subsystem for Linux)
- Compiler version: clang 6.0
- CPU type: x86_64
- cjxl/djxl version string: JPEG XL decoder v0.7.0 6692183 [Scalar] | Use of uninitialized value in tools/djxl.cc - MSan | https://api.github.com/repos/libjxl/libjxl/issues/840/comments | 3 | 2021-11-11T10:48:36Z | 2021-11-11T12:32:09Z | https://github.com/libjxl/libjxl/issues/840 | 1,050,844,297 | 840 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
When djxl is compiled with MSan it produces a stack trace when provided with any input file:
```
JPEG XL decoder v0.7.0 3dcc100 [SSE4,Scalar]
==12274==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x55e1bea80e7d in std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::_M_erase(std::_Rb_tree_node<unsigned int>*) /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_tree.h:1911:7
#1 0x55e1bea80df1 in std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::_M_erase(std::_Rb_tree_node<unsigned int>*) /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_tree.h:1913:4
#2 0x55e1bea7fc46 in std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::~_Rb_tree() /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_tree.h:995:9
#3 0x55e1bea7fc46 in std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> >::~set() /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_set.h:281:22
#4 0x55e1bea7fc46 in jpegxl::tools::cpu::(anonymous namespace)::X64_Topology::Field::~Field() /home/fuzzing/libjxl/tools/cpu/cpu.cc:352:9
#5 0x55e1bea7fc46 in jpegxl::tools::cpu::(anonymous namespace)::X64_Topology::Detect(jpegxl::tools::cpu::ProcessorTopology*) /home/fuzzing/libjxl/tools/cpu/cpu.cc:174:3
#6 0x55e1bea7fc46 in jpegxl::tools::cpu::DetectProcessorTopology(jpegxl::tools::cpu::ProcessorTopology*) /home/fuzzing/libjxl/tools/cpu/cpu.cc:402:7
#7 0x55e1be0e0db2 in jpegxl::tools::DecompressArgs::ValidateArgs(jpegxl::tools::CommandLineParser const&) /home/fuzzing/libjxl/tools/djxl.cc:159:10
#8 0x55e1be0d2a2f in jpegxl::tools::(anonymous namespace)::DecompressMain(int, char const**) /home/fuzzing/libjxl/tools/djxl_main.cc:64:13
#9 0x55e1be0d2a2f in main /home/fuzzing/libjxl/tools/djxl_main.cc:209:10
#10 0x7f3cebe400b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#11 0x55e1be0567fd in _start (/home/fuzzing/libjxl/build/tools/djxl+0x2b7fd)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_tree.h:1911:7 in std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::_M_erase(std::_Rb_tree_node<unsigned int>*)
Exiting
```
**To Reproduce**
Just run djxl with the following input file (or any other input file) and without additional arguments:
[075bb593caad6f86133d8ad630e4fa6d.png.jxl.txt](https://github.com/libjxl/libjxl/files/7492881/075bb593caad6f86133d8ad630e4fa6d.png.jxl.txt)
**Expected behavior**
djxl should not make use of an uninitialized value and probably add some additional assertions or similar. Looking at past reported issues it is possible that this is just a false alert, however.
**Environment**
- OS: Ubuntu 20.04
- Compiler version: clang 9.0
- CPU type: x86_64
- cjxl/djxl version string: JPEG XL decoder v0.7.0 3dcc100 [SSE4,Scalar]
**Additional context**
This bug was found while trying to fuzz libjxl with MSan instrumentation as part of a university project. | Use of uninitialized value in tools/cpu/cpu.cc - MSan | https://api.github.com/repos/libjxl/libjxl/issues/824/comments | 0 | 2021-11-08T16:15:43Z | 2021-11-08T20:44:09Z | https://github.com/libjxl/libjxl/issues/824 | 1,047,640,151 | 824 |
[
"libjxl",
"libjxl"
] | as it says in the title, i was doing bulk transcode of manga jpg's and it failed on some while working on others from the same batch of files, which is pretty strange given the fact that i assume in manga pages are processed in bulk with the same settings
heres the logs
```
cjxl -v Aria_v01_007.jpg try.jxl
JPEG XL encoder v0.7.0 a3571ec4 [SSE4,Scalar]
Read 853x1200 image, 124.1 MP/s
Encoding [Container | JPEG, lossless transcode, squirrel | JPEG reconstruction data], 2 threads.
Compressed to 173811 bytes (1.358 bpp).
853 x 1200, 13.48 MP/s [13.48, 13.48], 1 reps, 2 threads.
Average butteraugli iters: 0.00
Total layer bits headers 0.008350% 116
Total layer bits TOC 0.025984% 361
Total layer bits quantizer 0.001799% 25
Total layer bits quant tables 0.008422% 117
Total layer bits order 0.016411% 228 [c/i: 1.00 | hst: 1 | ex: 6 | h+c+e: 29.126]
Total layer bits DC 5.269136% 73204
Total layer bits ControlFields 0.003599% 50
Total layer bits AC 0.925000% 12851 [c/i: 78.00 | hst: 1590 | ex: 0 | h+c+e: 142078.595]
Total layer bits ACTokens 93.573661% 1300017
Total layer bits modularGlobal 0.109624% 1523 [c/i: 11.00 | hst: 190 | ex: 0 | h+c+e: 6416.376]
Total layer bits modularTree 0.058015% 806 [c/i: 2.00 | hst: 30 | ex: 21 | h+c+e: 97.069]
Total image size 1389298 [c/i: 92.00 | hst: 1813 | ex: 24783 | h+c+e: 173376.666]
```
vs one that worked
```
Average butteraugli iters: 0.00
Total layer bits headers 0.007296% 102
Total layer bits TOC 0.025823% 361
Total layer bits quantizer 0.001788% 25
Total layer bits quant tables 0.008369% 117
Total layer bits order 0.014020% 196 [c/i: 1.00 | hst: 1 | ex: 4 | h+c+e: 25.397]
Total layer bits DC 5.437647% 76017
Total layer bits ControlFields 0.021889% 306
Total layer bits AC 0.993293% 13886 [c/i: 75.00 | hst: 1706 | ex: 0 | h+c+e: 142758.850]
Total layer bits ACTokens 93.329285% 1304721
Total layer bits modularGlobal 0.099787% 1395 [c/i: 9.00 | hst: 174 | ex: 0 | h+c+e: 6925.644]
Total layer bits modularTree 0.060802% 850 [c/i: 2.00 | hst: 32 | ex: 21 | h+c+e: 101.497]
Total image size 1397976 [c/i: 87.00 | hst: 1915 | ex: 24603 | h+c+e: 174388.513]
Including container: 175378 bytes (1.367 bpp).
Allocations: 477 (max bytes in use: 3.204004E+07)
```
(sorry if the logs are a bit too big)
i can provide the samples just tell me how | cjxl crashes with some black and white images | https://api.github.com/repos/libjxl/libjxl/issues/822/comments | 8 | 2021-11-08T13:38:40Z | 2022-04-07T07:49:46Z | https://github.com/libjxl/libjxl/issues/822 | 1,047,461,798 | 822 |
[
"libjxl",
"libjxl"
] | Most formats have image DPI infos in the file header, no such thing in JXL?
Converting PNG (with DPI infos in the file header) to JXL and back (using cjxl.exe and djxl.exe) => DPI infos are lost. | Missing DPI infos in JXL format | https://api.github.com/repos/libjxl/libjxl/issues/817/comments | 5 | 2021-11-06T10:50:05Z | 2024-08-08T17:15:37Z | https://github.com/libjxl/libjxl/issues/817 | 1,046,483,003 | 817 |
[
"libjxl",
"libjxl"
] | Hello,
I am unable to transcode some JPG images to JXL. Majority of them works, but some some them trigger error.
Example:
[mobile_photo.zip](https://github.com/libjxl/libjxl/files/7451997/mobile_photo.zip)
```
cjxl IMG_20211031_140031.jpg compressed.jxl
JPEG XL encoder v0.7.0 2b5e77c [AVX2]
Read 4624x2604 image, 148.7 MP/s
Encoding [Container | JPEG, lossless transcode, squirrel | JPEG reconstruction data | 16901-byte Exif | 749-byte XMP], 2 threads.
Compressed to 2361249 bytes (1.569 bpp).
4624 x 2604, 43.90 MP/s [43.90, 43.90], 1 reps, 2 threads.
./lib/jxl/fields.cc:729: JXL_FAILURE: No feasible selector for 9936393
./lib/jxl/fields.cc:487: JXL_RETURN_IF_ERROR code=1: ok_
./lib/jxl/fields.cc:632: JXL_RETURN_IF_ERROR code=1: CanEncode(fields, &extension_bits, &total_bits)
./lib/jxl/jpeg/enc_jpeg_data.cc:235: JXL_RETURN_IF_ERROR code=1: Bundle::Write(jpeg_data, &writer, 0, nullptr)
./tools/cjxl_main.cc:107: JXL_RETURN_IF_ERROR code=1: EncodeJPEGData(data_in, &jpeg_data)
``` | lossless transcode JPG->JXL failed | https://api.github.com/repos/libjxl/libjxl/issues/803/comments | 8 | 2021-11-01T09:10:58Z | 2021-11-19T15:08:28Z | https://github.com/libjxl/libjxl/issues/803 | 1,040,944,397 | 803 |
[
"libjxl",
"libjxl"
] | Right now you have to manually choose the output format (as far as I'm aware). Quite often I have to decode a JXL file for use in programs that don't and probably never will support JXL. The problem is in many cases I'm not sure if the source file was a JPEG or a PNG (or other lossless format). It would be nice if djxl could automatically choose the output format on request that best fits the input JXL.
| Suggestion: Allow djxl to automatically choose the output format | https://api.github.com/repos/libjxl/libjxl/issues/786/comments | 0 | 2021-10-27T16:03:11Z | 2022-03-31T19:02:36Z | https://github.com/libjxl/libjxl/issues/786 | 1,037,597,730 | 786 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Hi, this 8 byte input file (found by fuzzing)
[SIGSEGV.PC.555555573116.STACK.140516608b.CODE.128.ADDR.0.INSTR.movslq_0x8(%rdx),%rdi.fuzz.verified.txt](https://github.com/libjxl/libjxl/files/7425387/SIGSEGV.PC.555555573116.STACK.140516608b.CODE.128.ADDR.0.INSTR.movslq_0x8.rdx.rdi.fuzz.verified.txt) causes a segmentation fault when trying to decode with djxl.
**To Reproduce**
command to reproduce the issue:
djxl 'SIGSEGV.PC.555555573116.STACK.140516608b.CODE.128.ADDR.0.INSTR.movslq_0x8(%rdx),%rdi.fuzz.verified.txt' --allow_partial_files --allow_more_progressive_steps
**Expected behavior**
The decoder should produce an error message without segmentation fault.
**Screenshots**
ASAN outputs for different djxl versions:


**Environment**
- OS: Ubuntu 20.04
- Compiler version: clang 10.0.0
- CPU type: x86_64
- cjxl/djxl version string: djxl [v0.7.0 35ca355 asan [AVX3,AVX2,SSE4,Scalar]]
- cjxl/djxl version string: djxl [v0.7.0 835aa02 asan [AVX3,AVX2,SSE4,Scalar]]
**Additional context**
The file was found using fuzzing (honggfuzz). | Segmentation fault with djxl | https://api.github.com/repos/libjxl/libjxl/issues/781/comments | 0 | 2021-10-27T10:56:37Z | 2021-10-27T13:23:54Z | https://github.com/libjxl/libjxl/issues/781 | 1,037,273,646 | 781 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
From the result of bisection, since commit 2a1e53af540fdc6637c4517cf8d721c9a47a4dc6 (Tweaks to DC and AC deadzone quantization (#691)), a (small) image compressed with effort 9 is bigger than effort 3, and it is actually larger than before.
The issue was spotted by the GDAL regression test suite: https://github.com/OSGeo/gdal/runs/4004536126?check_suite_focus=true
**To Reproduce**
on attached image

```
cjxl rgbsmall.png out_before_e9.jxl -e 9
cjxl rgbsmall.png out_before_e3.jxl -e 3
ls -al out_before_e3.jxl out_before_e9.jxl
```
Size in bytes:
out_e3.jxl: 1381
out_e9.jxl: 1509
With previous commit (f34a2667fe3195bfa06b4dae2e6ea598ad9e3d9f):
out_before_e3.jxl: 1421
out_before_e9.jxl: 1415
**Expected behavior**
File size with effort 9 should be <= effort 3
**Environment**
- OS: Ubuntu 20.04
- Compiler version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
- CPU type: x86_64
- cjxl/djxl version string: cjxl v0.7.0 2a1e53a [AVX2,SSE4,Scalar]
| [regression] Size of lossy effort 9 > effort 3 | https://api.github.com/repos/libjxl/libjxl/issues/771/comments | 3 | 2021-10-26T08:16:25Z | 2021-10-27T15:24:22Z | https://github.com/libjxl/libjxl/issues/771 | 1,035,984,864 | 771 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
```
The following tests FAILED:
898 - conformance_tooling_test (Failed)
Errors while running CTest
```
**To Reproduce**
build with tests i guess. i got it when building libjxl-git archlinux aur pkg
**Expected behavior**
test passes
**Screenshots**
If applicable, add screenshots or example input/output images to help explain your problem.
```
+ local decoder=/home/anon/.cache/yay/libjxl-git/src/build/tools/conformance/djxl_conformance
+ /home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/generator.py --decoder=/home/anon/.cache/yay/libjxl-git/src/build/tools/conformance/djxl_conformance --output=/tmp/tmp.9yhRhkuYge --peak_error=0.001 --rmse=0.001 /home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/../../third_party/testdata/jxl/blending/cropped_traffic_light.jxl
Generating cropped_traffic_light
+ tree /tmp/tmp.9yhRhkuYge
/tmp/tmp.9yhRhkuYge
├── corpus.txt
└── cropped_traffic_light
├── input.jxl
├── original.icc
├── reference.icc
├── reference_image.npy
└── test.json
1 directory, 6 files
+ /home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/conformance.py --decoder=/home/anon/.cache/yay/libjxl-git/src/build/tools/conformance/djxl_conformance --corpus=/tmp/tmp.9yhRhkuYge
Testing cropped_traffic_light
Traceback (most recent call last):
File "/home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/conformance.py", line 218, in <module>
main()
File "/home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/conformance.py", line 213, in main
if not ConformanceTestRunner(args):
File "/home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/conformance.py", line 120, in ConformanceTestRunner
del descriptor['sha256sums']
KeyError: 'sha256sums'
+ retcode=1
<end of output>
Test time = 0.22 sec
----------------------------------------------------------
Test Failed.
"conformance_tooling_test" end time: Oct 22 23:05 EEST
"conformance_tooling_test" time elapsed: 00:00:00
----------------------------------------------------------
End testing: Oct 22 23:05 EEST
```
**Environment**
- OS: archlinux
- Compiler version: <irrelevant i think as it fails in python>
- CPU type: x86_64
- cjxl/djxl version string: current master
**Additional context**
https://aur.archlinux.org/packages/libjxl-git/
| confirmance_tooling_test fails due to sha256sums keyerror | https://api.github.com/repos/libjxl/libjxl/issues/765/comments | 0 | 2021-10-22T20:10:57Z | 2021-10-22T20:38:37Z | https://github.com/libjxl/libjxl/issues/765 | 1,033,913,575 | 765 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Can't encode the image
<img src=https://user-images.githubusercontent.com/11173476/138491058-fadbcb58-223d-4311-9212-144fc9acb42d.jpg width=200/>
**To Reproduce**
```
cjxl 0.jpg -j
JPEG XL encoder v0.7.0 0c3c093 [SSE4]
./lib/extras/packed_image_convert.cc:125: JXL_ASSERT: io->metadata.m.color_encoding.IsGray() == (frame.color.format.num_channels <= 2)
```
**Environment**
- OS: Windows
- Compiler version: clang 13.0.0
- CPU type: x64
- cjxl/djxl version string: JPEG XL encoder v0.7.0 0c3c093 [SSE4] | `cjxl` - lossy encoding grayscale jpeg fails | https://api.github.com/repos/libjxl/libjxl/issues/764/comments | 5 | 2021-10-22T16:41:55Z | 2021-11-17T16:54:11Z | https://github.com/libjxl/libjxl/issues/764 | 1,033,770,716 | 764 |
[
"libjxl",
"libjxl"
] | Hello,
especially on 32bit systems, there is very easy to run out of available memory (address space is limited).
It is enough to have few large images with float precision and together with other objects/libraries the address space is exhausted.
I can easily get following assertion when decoding another big image:
`./lib/jxl/image.cc:94: JXL_CHECK: bytes_.get()`
It is from:
```
bytes_ = AllocateArray(bytes_per_row_ * ysize);
JXL_CHECK(bytes_.get());
```
Unfortunately it aborts whole process/application.
I'd prefer if decoding just returns with an error without closing the whole application. | better handling of memory allocation failures | https://api.github.com/repos/libjxl/libjxl/issues/762/comments | 1 | 2021-10-22T08:51:38Z | 2022-04-07T10:21:53Z | https://github.com/libjxl/libjxl/issues/762 | 1,033,338,696 | 762 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
conformance_tooling_test failing
**To Reproduce**
(too lazy)
**Expected behavior**
that test aint failin
**Screenshots**
```
898/898 Testing: conformance_tooling_test
898/898 Test: conformance_tooling_test
Command: "/usr/bin/bash" "/home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/tooling_test.sh" "/home/anon/.cache/yay/libjxl-git/src/build"
Directory: /home/anon/.cache/yay/libjxl-git/src/build/tools/conformance
"conformance_tooling_test" start time: Oct 20 21:35 EEST
Output:
----------------------------------------------------------
+ CLEANUP_FILES=()
+ trap 'retcode=$?; { set +x; } 2>/dev/null; cleanup' INT TERM EXIT
+ main /home/anon/.cache/yay/libjxl-git/src/build
++ mktemp -d
+ local tmpdir=/tmp/tmp.4sQrepJcsK
+ CLEANUP_FILES+=("${tmpdir}")
+ python3 -c 'import numpy'
+ local build_dir=/home/anon/.cache/yay/libjxl-git/src/build
+ [[ -z /home/anon/.cache/yay/libjxl-git/src/build ]]
+ local decoder=/home/anon/.cache/yay/libjxl-git/src/build/tools/conformance/djxl_conformance
+ /home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/generator.py --decoder=/home/anon/.cache/yay/libjxl-git/src/build/tools/conformance/djxl_conformance --output=/tmp/tmp.4sQrepJcsK /home/anon/.cache/yay/libjxl-git/src/libjxl/tools/conformance/../../third_party/testdata/jxl/blending/cropped_traffic_light.jxl
usage: generator.py [-h] --decoder DECODER --output DIR --peak_error
PEAK_ERROR --rmse RMSE
JXL [JXL ...]
generator.py: error: the following arguments are required: --peak_error, --rmse
+ retcode=2
<end of output>
Test time = 0.33 sec
----------------------------------------------------------
Test Failed.
"conformance_tooling_test" end time: Oct 20 21:35 EEST
"conformance_tooling_test" time elapsed: 00:00:00
----------------------------------------------------------
```
**Environment**
- OS: archlinux
- Compiler version: (probably irrelevant)
- CPU type: x86_64
- cjxl/djxl version string: current master fails to build
**Additional context**
building using libjxl-git aur pkgbuild
| conformance_tooling_test failing | https://api.github.com/repos/libjxl/libjxl/issues/758/comments | 0 | 2021-10-20T18:40:45Z | 2021-10-21T16:38:21Z | https://github.com/libjxl/libjxl/issues/758 | 1,031,720,022 | 758 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Attempting to encode an animated PNG with `cjxl input.png output.jxl` yields an error message: `Failed to read image input.png` and exits.
**To Reproduce**
Take the animated PNG located at [https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png](https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png) and save it as `input.png`. [web.archive.org permalink](https://web.archive.org/web/20211014172423/https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png)
```
$ sha1sum input.png
4024517347a89acc6646e9266c946b4a61cbe531 input.png
$ cjxl input.png output.jxl
JPEG XL encoder v0.7.0 116326a [AVX2]
Failed to read image input.png.
```
**Expected behavior**
I'd expect `cjxl` to produce an animated jxl without error. The local file can be read just fine with Firefox and other software that works with animated PNGs.
**Environment**
- OS: `Linux 5.14.12-arch1-1 x86_64`
- Compiler version: `gcc version 11.1.0 (GCC)`
- cjxl/djxl version string: `cjxl v0.7.0 116326a [AVX2]`
**Additional context**
Renaming the file did not change the results. Using `-d 0` and `-d 1` also did not change the results.
| Failed to read image when encoding animated PNG | https://api.github.com/repos/libjxl/libjxl/issues/756/comments | 2 | 2021-10-20T16:29:56Z | 2021-12-29T10:11:27Z | https://github.com/libjxl/libjxl/issues/756 | 1,031,607,862 | 756 |
[
"libjxl",
"libjxl"
] | **Is your feature request related to a problem? Please describe.**
In [Developing on Windows with Visual Studio 2019](https://github.com/libjxl/libjxl/blob/11af749907d4f30889851379af01ec98f5dc0197/doc/developing_in_windows_vcpkg.md) documentation, only x64 instructions are written.
**Describe the solution you'd like**
It would be nice if there were also instructions for building for x86
**Describe alternatives you've considered**
None
**Additional context**
None
| Add documentition for building for 32bit windows target | https://api.github.com/repos/libjxl/libjxl/issues/754/comments | 0 | 2021-10-20T14:23:16Z | 2024-03-04T10:19:37Z | https://github.com/libjxl/libjxl/issues/754 | 1,031,474,995 | 754 |
[
"libjxl",
"libjxl"
] | #750 added MSYS2 with gcc, we can also test MSYS2 with clang. See the details @kmilos wrote in this comment: https://github.com/libjxl/libjxl/pull/750#issuecomment-947459334 | Test on MSYS2 + clang{32,64} | https://api.github.com/repos/libjxl/libjxl/issues/753/comments | 0 | 2021-10-20T11:47:27Z | 2024-03-04T10:27:18Z | https://github.com/libjxl/libjxl/issues/753 | 1,031,312,022 | 753 |
[
"libjxl",
"libjxl"
] | Since `.h` files are ambiguous, with respect to C and C++, it might be worth indicating which can be used with C and which require C++. On my Linux system, a number of files have a first-line comment containing `-*- C -*-` or `-*- C++ -*-`. Apparently, emacs uses this to identify the file type. I know there are other editors that also use it, so they can collect symbol and text completion data. | Should header files be marked as for C or C++? | https://api.github.com/repos/libjxl/libjxl/issues/741/comments | 2 | 2021-10-17T15:21:04Z | 2021-12-11T06:53:09Z | https://github.com/libjxl/libjxl/issues/741 | 1,028,355,772 | 741 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
Debian jxl package won't install on debian unstable due to missing dependency `libjpeg8`
Debian unstable packages libjpeg9 instead, which I suspect could be a drop-in replacement.
**To Reproduce**
Try and install the debian package on debian unstable.
**Expected behavior**
It install, probably by using libjpeg9 in place of libjpeg8.
**Screenshots**

**Environment**
- OS: `Linux 5.14.0-2-amd64 #1 SMP Debian 5.14.9-2 (2021-10-03) x86_64 GNU/Linux`
- Compiler version: N/A
- CPU type: x86_64
- cjxl/djxl version string: 0.7~alpha20211015180802-0+git35ca355
**Additional context**
Build from [artifacts.lucaversari.it](https://artifacts.lucaversari.it/) | Debian jxl package depends on version of libjpeg not in latest debian | https://api.github.com/repos/libjxl/libjxl/issues/740/comments | 3 | 2021-10-17T13:10:52Z | 2021-10-18T11:59:52Z | https://github.com/libjxl/libjxl/issues/740 | 1,028,320,015 | 740 |
[
"libjxl",
"libjxl"
] | Hello, this 161 byte JPEG-XL image, found via fuzz testing, causes a segfault during decoding (using the latest commit on the `main` branch).
https://github.com/libjxl/libjxl/files/7348994/fuzz39533.jxl.txt
```
==1086695==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x7fb932913530 (pc 0x00000153da11 bp 0x7fb9343f5bb0 sp 0x7fb9343f5b50 T1086698)
==1086695==The signal is caused by a READ memory access.
#0 0x153da11 in jxl::N_AVX2::(anonymous namespace)::DrawSegment(jxl::SplineSegment const&, bool, unsigned long, long, long, float* restrict*) libjxl/lib/jxl/splines.cc:86:37
#1 0x153c987 in jxl::N_AVX2::(anonymous namespace)::DrawSegments(jxl::Image3<float>*, jxl::Rect const&, jxl::Rect const&, bool, jxl::SplineSegment const*, unsigned long const*, unsigned long const*) libjxl/lib/jxl/splines.cc:151:5
#2 0x15353f5 in void jxl::Splines::Apply<true>(jxl::Image3<float>*, jxl::Rect const&, jxl::Rect const&) const libjxl/lib/jxl/splines.cc:556:5
#3 0x14de591 in jxl::FinalizeImageRect(jxl::Image3<float>*, jxl::Rect const&, std::__1::vector<std::__1::pair<jxl::Plane<float>*, jxl::Rect>, std::__1::allocator<std::__1::pair<jxl::Plane<float>*, jxl::Rect> > > const&, jxl::PassesDecoderState*, unsigned long, jxl::ImageBundle*, jxl::Rect const&) libjxl/lib/jxl/dec_reconstruct.cc:912:28
#4 0x1711d27 in jxl::PassesDecoderState::FinalizeGroup(unsigned long, unsigned long, jxl::Image3<float>*, jxl::ImageBundle*) libjxl/lib/jxl/dec_cache.cc:164:5
#5 0x141bed3 in jxl::N_AVX2::DecodeGroupImpl(jxl::GetBlock*, jxl::GroupDecCache*, jxl::PassesDecoderState*, unsigned long, unsigned long, jxl::ImageBundle*, jxl::DrawMode) libjxl/lib/jxl/dec_group.cc:441:5
#6 0x142fc1e in jxl::DecodeGroup(jxl::BitReader* restrict*, unsigned long, unsigned long, jxl::PassesDecoderState*, jxl::GroupDecCache*, unsigned long, jxl::ImageBundle*, unsigned long, bool, bool) libjxl/lib/jxl/dec_group.cc:754:3
#7 0x14048da in jxl::FrameDecoder::ProcessACGroup(unsigned long, jxl::BitReader* restrict*, unsigned long, unsigned long, bool, bool) libjxl/lib/jxl/dec_frame.cc:579:5
#8 0x140b6ef in operator() libjxl/lib/jxl/dec_frame.cc:744:16
```
It looks like, when drawing spline segments, `segment_y_start` for this image contains 253 entries but `image_rect.y0()` can return higher values for `y` that result in `DrawSegment()` reading beyond the end of this.
https://github.com/libjxl/libjxl/blob/795ba9c3dd45294947d6777910e0ac6e04e59ef4/lib/jxl/splines.cc#L149-L153
The following patch to `Apply()` demonstrates a possible guard to prevent the segfault, but there's almost certainly a better way to fix this.
```diff
--- a/lib/jxl/splines.cc
+++ b/lib/jxl/splines.cc
@@ -552,6 +552,7 @@ template <bool add>
void Splines::Apply(Image3F* const opsin, const Rect& opsin_rect,
const Rect& image_rect) const {
if (segments_.empty()) return;
+ if (image_rect.y0() >= segment_y_start_.size()) return;
for (size_t iy = 0; iy < image_rect.ysize(); iy++) {
HWY_DYNAMIC_DISPATCH(DrawSegments)
(opsin, opsin_rect.Line(iy), image_rect.Line(iy), add, segments_.data(),
```
| splines: segfault due to out of bounds access of segment array | https://api.github.com/repos/libjxl/libjxl/issues/735/comments | 7 | 2021-10-14T20:01:32Z | 2021-11-01T21:54:23Z | https://github.com/libjxl/libjxl/issues/735 | 1,026,770,643 | 735 |
[
"libjxl",
"libjxl"
] | Problems with current system:
- works only on x86_64, Mac, Haiku
- asm not portable to other archs, even in theory: CPUID-type instructions are usually not available to userspace
- on unsupported systems, always returns 1
- doesn't handle affinity on Mac or Haiku
- mishandles "mismatched" affinities on x86_64: e.g. set 0.0, 1.0, 1.1, libjxl will pick 4 threads (2 packages * 2 cores per package)
- too complicated especially considering it doesn't actually accomplish the intended calculation (see previous point)
What to replace it with though?
First, we need to decide what exactly the goal is. Is it necessary to handle affinity or filter out SMT siblings? If neither, libjxl can simply use `std::thread::hardware_concurrency`. libstdc++ (except on glibc 2.34 exactly) and libc++ don't currently handle affinity, but I think they would accept patches to do so.
SMT is likely outside of the scope of C++ standard functions though. If it is necessary to exclude SMT siblings, then AFAICT, it is necessary to use OS-specific APIs. I found the library [hwloc](https://www.open-mpi.org/projects/hwloc/) to wrap these APIs, but it is quite heavy and seems to be primarily intended for large applications on "big compute", including many features such as NUMA, PCI, and GL detection, as well as Cairo, SVG, and XML output, among many others. I think it would be overkill to add it as a dependency solely for detecting SMT. The APIs for detecting SMT on Windows and Linux are not especially complex, but they are not trivial.
So, the question is: how much benefit is there from excluding SMT? Based on my benchmarks of encoding and decoding some random 4k-ish image using libjxl ~20211010 at efforts 1..9 and num_threads 0,1,2,ncpus/2,ncpus on my Ryzen 1600 desktop and i5-8250U laptop, it seems that 0,1,2 are much slower (as expected), and ncpus is between 5% slower and 15% faster in real time compared to ncpus/2, but roughly double cpu time. Doing some quick perf stat checks, the rate of cache-misses (L3 I think) on Ryzen and LLC-misses on Intel is quite high, which supports the theory that memory bandwidth is a significant limiting factor. Therefore, the results are mixed: SMT is generally faster, but not by much, and it may be overall more efficient for the user to limit the number of threads to allow other programs to run, since CPU time spent waiting on disk can be yielded to other programs, but CPU time spent with both SMTs waiting on RAM is effectively lost.
In my opinion, the best option is to default to `std::thread::hardware_concurrency`, and document that libjxl may not use SMT effectively on some platforms, so it may be more efficient to reduce the number of threads. | Simplify num_threads detection | https://api.github.com/repos/libjxl/libjxl/issues/734/comments | 3 | 2021-10-14T19:34:05Z | 2021-11-08T20:44:09Z | https://github.com/libjxl/libjxl/issues/734 | 1,026,749,321 | 734 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
HWY acceleration changes how lossy .jxl files are decoded
**To Reproduce**
```
$ cjxl -d 1.0 in.jpg in.jxl
$ djxl in.jxl accel.jpg
```
Add a call to disable hw acceleration in libjxl/tools/djxl_main.cc
```
int main(int argc, const char* argv[]) {
hwy::DisableTargets(~0u);
return jpegxl::tools::DecompressMain(argc, argv);
}
```
Recompile, and then try decoding again:
```
$ djxl in.jxl noaccel.jpg
$ diff accel.jpg noaccel.jpg
Binary files accel.jpg and noaccel.jpg differ
```
**Expected behavior**
The two JPEGs should be decoded identically regardless of hw acceleration
**Environment**
- OS: Mac OS X 11.3.1
- Compiler version: Apple clang version 13.0.0 (clang-1300.0.18.6)
- CPU type: x86_64
- cjxl/djxl version string:
- djxl v0.7.0 28a26e6 [AVX2,SSE4]
- djxl v0.7.0 28a26e6 [SSE4] (w/ hw accel disabled)
| djxl decodes lossy .jxl files to different jpegs depending on if hardware acceleration is turned off | https://api.github.com/repos/libjxl/libjxl/issues/733/comments | 1 | 2021-10-14T17:21:20Z | 2021-10-28T09:12:21Z | https://github.com/libjxl/libjxl/issues/733 | 1,026,642,527 | 733 |
[
"libjxl",
"libjxl"
] | Hi,
In the release mode the static Libs/binaries should not contain the filenames (for sure not the full path) of the CC files used in several error messages/warning/asserts.
I found the "__FILE__" usage in:
(version 0.6)
hwy\base.h
decode.cc
encode.cc
base\status.h
This is nice in Debug mode, but not in the Release mode ... or add a flag to CMake.
| Several static Libs/Binaries contain full path of (many) CC files for errors/asserts/warnings | https://api.github.com/repos/libjxl/libjxl/issues/730/comments | 6 | 2021-10-14T12:05:23Z | 2021-10-15T13:04:51Z | https://github.com/libjxl/libjxl/issues/730 | 1,026,315,250 | 730 |
[
"libjxl",
"libjxl"
] | Hello - firstly, thank you for `libjxl`, I am very much looking forward to implementing it.
I am compiling on Ubuntu 20.04 with `libavif` already installed, and I get a `cmake` error toward the end of the process:
```
Scanning dependencies of target djxl
[ 92%] Building CXX object tools/CMakeFiles/djxl.dir/djxl_main.cc.o
[ 93%] Linking CXX executable djxl
[ 93%] Built target djxl
Scanning dependencies of target cjxl
[ 93%] Building CXX object tools/CMakeFiles/cjxl.dir/cjxl.cc.o
[ 94%] Building CXX object tools/CMakeFiles/cjxl.dir/speed_stats.cc.o
[ 94%] Building CXX object tools/CMakeFiles/cjxl.dir/cjxl_main.cc.o
[ 94%] Linking CXX executable cjxl
[ 94%] Built target cjxl
Scanning dependencies of target benchmark_xl
[ 94%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_xl.cc.o
[ 94%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_args.cc.o
[ 95%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec.cc.o
[ 95%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_file_io.cc.o
[ 95%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_stats.cc.o
[ 96%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_utils.cc.o
[ 96%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_custom.cc.o
[ 96%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_jxl.cc.o
[ 97%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_png.cc.o
[ 97%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/speed_stats.cc.o
[ 97%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/__/third_party/dirent.cc.o
[ 98%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_jpeg.cc.o
[ 98%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_webp.cc.o
[ 98%] Building CXX object tools/CMakeFiles/benchmark_xl.dir/benchmark/benchmark_codec_avif.cc.o
[100%] Linking CXX executable benchmark_xl
/usr/bin/ld: /usr/local/lib/libavif.a(codec_aom.c.o): in function `aomCodecDestroyInternal':
codec_aom.c:(.text+0x25): undefined reference to `aom_codec_destroy'
/usr/bin/ld: codec_aom.c:(.text+0x39): undefined reference to `aom_codec_destroy'
/usr/bin/ld: /usr/local/lib/libavif.a(codec_aom.c.o): in function `aomCodecEncodeFinish.part.0':
codec_aom.c:(.text+0x8d): undefined reference to `aom_codec_encode'
/usr/bin/ld: codec_aom.c:(.text+0xba): undefined reference to `aom_codec_get_cx_data'
/usr/bin/ld: codec_aom.c:(.text+0xf7): undefined reference to `aom_codec_error_detail'
/usr/bin/ld: codec_aom.c:(.text+0x107): undefined reference to `aom_codec_error'
/usr/bin/ld: /usr/local/lib/libavif.a(codec_aom.c.o): in function `aomCodecGetNextImage':
codec_aom.c:(.text+0x1b7): undefined reference to `aom_codec_get_frame'
/usr/bin/ld: codec_aom.c:(.text+0x1e4): undefined reference to `aom_codec_decode'
/usr/bin/ld: codec_aom.c:(.text+0x225): undefined reference to `aom_codec_get_frame'
/usr/bin/ld: codec_aom.c:(.text+0x2fb): undefined reference to `aom_codec_av1_dx'
/usr/bin/ld: codec_aom.c:(.text+0x316): undefined reference to `aom_codec_dec_init_ver'
/usr/bin/ld: codec_aom.c:(.text+0x338): undefined reference to `aom_codec_control'
/usr/bin/ld: /usr/local/lib/libavif.a(codec_aom.c.o): in function `aomCodecEncodeImage':
codec_aom.c:(.text+0x6a5): undefined reference to `aom_codec_version'
/usr/bin/ld: codec_aom.c:(.text+0x756): undefined reference to `aom_codec_av1_cx'
/usr/bin/ld: codec_aom.c:(.text+0x774): undefined reference to `aom_codec_enc_config_default'
/usr/bin/ld: codec_aom.c:(.text+0x95e): undefined reference to `aom_codec_enc_init_ver'
/usr/bin/ld: codec_aom.c:(.text+0x9a3): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0x9e2): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xa7d): undefined reference to `aom_codec_set_option'
/usr/bin/ld: codec_aom.c:(.text+0xb86): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xbb5): undefined reference to `aom_img_alloc'
/usr/bin/ld: codec_aom.c:(.text+0xbe5): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xcce): undefined reference to `aom_codec_encode'
/usr/bin/ld: codec_aom.c:(.text+0xd02): undefined reference to `aom_codec_get_cx_data'
/usr/bin/ld: codec_aom.c:(.text+0xd0f): undefined reference to `aom_img_free'
/usr/bin/ld: codec_aom.c:(.text+0xd52): undefined reference to `aom_codec_destroy'
/usr/bin/ld: codec_aom.c:(.text+0xdab): undefined reference to `aom_codec_version'
/usr/bin/ld: codec_aom.c:(.text+0xde5): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xeed): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xf04): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xf1b): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0xf32): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0x11b1): undefined reference to `aom_codec_error_detail'
/usr/bin/ld: codec_aom.c:(.text+0x11c1): undefined reference to `aom_codec_error'
/usr/bin/ld: codec_aom.c:(.text+0x11eb): undefined reference to `aom_codec_err_to_string'
/usr/bin/ld: codec_aom.c:(.text+0x1234): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0x1260): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0x127e): undefined reference to `aom_codec_control'
/usr/bin/ld: codec_aom.c:(.text+0x1294): undefined reference to `aom_codec_error_detail'
/usr/bin/ld: codec_aom.c:(.text+0x12a4): undefined reference to `aom_codec_error'
/usr/bin/ld: /usr/local/lib/libavif.a(codec_aom.c.o): in function `avifCodecVersionAOM':
codec_aom.c:(.text+0x12d5): undefined reference to `aom_codec_version_str'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tools/CMakeFiles/benchmark_xl.dir/build.make:306: tools/benchmark_xl] Error 1
make[1]: *** [CMakeFiles/Makefile2:1318: tools/CMakeFiles/benchmark_xl.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
```
I confirm I have installed the various libraries and packages for Ubuntu / Debian, and I'm using this build script which I've adapted to my environment:
```
rm -rf \
~/libjxl \
&& git clone https://github.com/libjxl/libjxl.git --recursive \
&& cd ~/libjxl \
&& git submodule update --init --recursive \
&& export CC=clang CXX=clang++ \
&& mkdir -p ~/libjxl/build \
&& cd ~/libjxl/build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. \
&& cmake --build . -- -j$(nproc) \
&& sudo cmake --install /usr/local/bin/ \
&& cd ~ \
&& rm -rf \
~/libjxl
```
`libavif` is compiled from source:
```
$ /usr/local/bin/avifenc --version
Version: 0.9.2 (aom [enc/dec]:3.1.1)
libyuv : unavailable
```
Edit: I'm using `clang` v10:
```
$ clang --version
clang version 10.0.0-4.focal
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
I would be grateful for any guidance or advice on resolving this error, especially further reading material to help me better understand why it's happening.
Thank you. | Compile issue on Ubuntu 20.04 | https://api.github.com/repos/libjxl/libjxl/issues/729/comments | 3 | 2021-10-14T09:43:05Z | 2021-10-14T11:42:14Z | https://github.com/libjxl/libjxl/issues/729 | 1,026,187,036 | 729 |
[
"libjxl",
"libjxl"
] | Some GIF, compressed with -d 0 -e 8, end up being larger than the original.
Typical example: https://dilbert.com/strip/1992-09-26 - GIF input is 147 kb, .JXL is 177 kb.
Actually nearly all Dilberts from before the year 2000, and some after that too.
Is this by design and cannot be changed, or does the encoder fail to compress those and they are supposed to be smaller? | Possible compression fail with some GIF - by design, or encoder failure? | https://api.github.com/repos/libjxl/libjxl/issues/727/comments | 33 | 2021-10-13T16:18:19Z | 2022-11-06T17:01:12Z | https://github.com/libjxl/libjxl/issues/727 | 1,025,449,142 | 727 |
[
"libjxl",
"libjxl"
] | Hi,
Crash in Hwy "base.h", function: "PopCount" when using "_mm_popcnt" on "old" CPU.
CPU: Intel(R) Core(TM)2 Quad CPU Q9400
Compiler: MSVC 2017 or 2019
JXL lib version: 0.6
Solution: use the native code in "PopCount".
Maybe this needs a flag in CMake or auto-detection of supported CPUs?
| Crash in Highway (base.h) with old CPU | https://api.github.com/repos/libjxl/libjxl/issues/726/comments | 2 | 2021-10-13T12:56:57Z | 2021-10-14T11:30:40Z | https://github.com/libjxl/libjxl/issues/726 | 1,025,216,887 | 726 |
[
"libjxl",
"libjxl"
] | Hello,
I downloaded genessa8.jxl from the old issue:
https://gitlab.com/wg1/jpeg-xl/-/issues/228
and I am unable to decode it using C API again. This problem was fixed in the past but it is happening again.
djxl can convert it but with warning:
`Warning: could not decode losslessly to JPEG. Retrying with --pixels_to_jpeg...`
jxlinfo gives following messages:
```
jxlinfo genessa8.jxl
box: type: "JXL " size: 12
box: type: "ftyp" size: 20
box: type: "jbrd" size: 2894
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/jpeg/jpeg_data.cc:106: JXL_FAILURE: Unknown app marker type 7
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/fields.cc:618: JXL_RETURN_IF_ERROR code=1: visitor.Visit(fields)
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/jpeg/dec_jpeg_data.cc:23: JXL_RETURN_IF_ERROR code=1: Bundle::Read(&br, jpeg_data)
Decoder error
Couldn't print basic info
``` | Unable to decode older JXL file using C API again | https://api.github.com/repos/libjxl/libjxl/issues/725/comments | 2 | 2021-10-13T09:59:15Z | 2022-03-31T12:55:35Z | https://github.com/libjxl/libjxl/issues/725 | 1,025,040,032 | 725 |
[
"libjxl",
"libjxl"
] | As a new user, i'm completly lost with the cmake options. Would it be possible to add comments at the top of CMakeLists.txt, which lists and document them, like in this project :
https://github.com/lexbor/lexbor/blob/master/CMakeLists.txt#L3
thank you
| Add cmake options at the top of CMakeLists.txt | https://api.github.com/repos/libjxl/libjxl/issues/723/comments | 3 | 2021-10-12T17:47:32Z | 2022-03-31T12:52:58Z | https://github.com/libjxl/libjxl/issues/723 | 1,024,083,522 | 723 |
[
"libjxl",
"libjxl"
] | Hello
is it normal that the release tarball does not contain third party libs ? Otherwise, it needs internet connection to download them
thank you | released tarbal and third party libs | https://api.github.com/repos/libjxl/libjxl/issues/722/comments | 1 | 2021-10-12T16:38:56Z | 2021-10-13T11:38:04Z | https://github.com/libjxl/libjxl/issues/722 | 1,024,024,893 | 722 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
When given a greyscale PNG as input, cjxl fails if the image has an RGB ICC profile.
**To Reproduce**
``cjxl greyscale_with_rgb_icc.png greyscale.ll.jxl -q 100`` or lossy:
``cjxl greyscale_with_rgb_icc.png greyscale.ll.jxl -q 90``
3 sample files provided in attachment.
Terminal output:
```
JPEG XL encoder v0.7.0 5a77302 [AVX2,SSE4,Scalar]
~/libjxl/lib/extras/packed_image_convert.cc:125: JXL_ASSERT: io->metadata.m.color_encoding.IsGray() == (frame.color.format.num_channels <= 2)
```
No output file ``greyscale.ll.jxl`` is created.
``cjxl greyscale_with_rgb_icc.png greyscale.ll.jxl -q 100 --strip`` behaves the same.
**Expected behavior**
RGB profiles on greyscale PNGs are not strictly valid. However, such PNGs are relatively common in the wild. They typically origin from software copying metadata verbatim, while re-encoding image contents, resulting in a mismatch between the colour mode and the ICC profile.
Other software, such as imagemagick, cwebp and flif print a warning about the ICC profile, but proceed to perform the encoding. I would expect cjxl to proceed with the encode too, possibly emitting a warning and possibly stripping the incorrect profile.
**Environment**
- OS: Ubuntu
- Compiler version: gcc 7.5.0
- CPU type: x86_64
- cjxl version string: ```cjxl v0.7.0 5a77302 [AVX2,SSE4,Scalar]```
[sample_images.zip](https://github.com/libjxl/libjxl/files/7326155/sample_images.zip)
| cjxl fails when given greyscale PNGs with RGB ICC profiles | https://api.github.com/repos/libjxl/libjxl/issues/720/comments | 3 | 2021-10-12T01:22:41Z | 2022-03-31T14:17:31Z | https://github.com/libjxl/libjxl/issues/720 | 1,023,260,305 | 720 |
[
"libjxl",
"libjxl"
] |
on Windows, MSYS2 + gcc, I have these warnings :
```
cc1plus.exe: note: unrecognized command-line option '-Wno-used-but-marked-unused' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-unused-template' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-unused-member-function' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-shadow-field-in-constructor' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-language-extension-token' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-global-constructors' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-c++98-compat-pedantic' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-used-but-marked-unused' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-unused-template' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-unused-member-function' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-shadow-field-in-constructor' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-language-extension-token' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-global-constructors' may have been intended to silence earlier diagnostics
cc1plus.exe: note: unrecognized command-line option '-Wno-c++98-compat-pedantic' may have been intended to silence earlier diagnostics
```
and
```
cc1plus.exe: warning: command-line option '-Wno-missing-prototypes' is valid for C/ObjC but not for C++
```
this one can be safely removed, I guess, as the code is c++
maybe there are more, but at least, if they are fixed, the output will have less garbage
| Windows (MSYS2 + gcc) huge number of "unrecognized command-line option"warnings | https://api.github.com/repos/libjxl/libjxl/issues/719/comments | 3 | 2021-10-11T18:34:29Z | 2021-10-19T15:07:31Z | https://github.com/libjxl/libjxl/issues/719 | 1,023,004,249 | 719 |
[
"libjxl",
"libjxl"
] | With some (old) Visual Studio versions, %z is not supported (as well as on MSYS2 with the macro __USE_MINGW_ANSI_STDIO set to 0). This leads to huge number of warnings. It can be fixed with a macro, like:
```
#ifdef _WIN32
# define FMT_ZU "%Iu"
#else
# define FMT_ZU "%zu"
#endif
```
and replace "foo %zu bar" with "foo " FMT_ZU " bar"
| Windows: %z is not recognized | https://api.github.com/repos/libjxl/libjxl/issues/718/comments | 8 | 2021-10-11T18:22:54Z | 2021-10-19T15:46:58Z | https://github.com/libjxl/libjxl/issues/718 | 1,022,995,517 | 718 |
[
"libjxl",
"libjxl"
] | hello
according to https://jpeg.org/jpegxl/, it is possible to have animated jpeg xl files. I would like to know :
* if this implementation supports animated jpep xl files
* if yes, are there some animated jpeg xl samples somewhere
thank ypu
| animated jpeg xl files | https://api.github.com/repos/libjxl/libjxl/issues/717/comments | 2 | 2021-10-11T15:55:10Z | 2021-10-13T09:04:08Z | https://github.com/libjxl/libjxl/issues/717 | 1,022,875,790 | 717 |
[
"libjxl",
"libjxl"
] | Hello
I am searching for samples of jpeg xl files. Does someone know where I can find some ?
thank you
| jpeg xl sample data base | https://api.github.com/repos/libjxl/libjxl/issues/716/comments | 4 | 2021-10-11T15:51:54Z | 2021-10-13T09:04:27Z | https://github.com/libjxl/libjxl/issues/716 | 1,022,872,931 | 716 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
the DLL is installed in $prefix/lib while it should be installed in $refix/bin.
**To Reproduce**
I compile with this script :
```
cmake \
-DCMAKE_TOOLCHAIN_FILE=cross_toolchain.txt \
-DCMAKE_INSTALL_PREFIX=/opt/jxl \
-DBUILD_SHARED_LIBS=ON \
-DJPEGXL_ENABLE_JNI:BOOL=FALSE \
-DJPEGXL_ENABLE_SKCMS:BOOL=FALSE \
-DBUILD_TESTING=OFF \
-DJPEGXL_FORCE_SYSTEM_BROTLI:BOOL=FALSE \
-DJPEGXL_FORCE_SYSTEM_HWY:BOOL=FALSE \
-G "Unix Makefiles" \
..
make -j7 install
```
**Expected behavior**
DLL should be installed in$prefix/in, but :
```
-- Installing: C:/Documents/msys2/opt/jxl/lib/libjxl.dll
```
**Environment**
- OS: [e.g. Windows] Windows
- Compiler version: [e.g. clang 11.0.1] gcc 10.3.0
- CPU type: [e.g. x86_64] x86_64
| Windows (MSYS2+mingw-w64) DLL is not installed in correct directory | https://api.github.com/repos/libjxl/libjxl/issues/715/comments | 9 | 2021-10-10T18:35:51Z | 2021-10-19T15:11:02Z | https://github.com/libjxl/libjxl/issues/715 | 1,022,059,226 | 715 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
building with -DBUILD_SHARED_LIBS:BOOL=TRUE, the static lib is built. But in CMakeList.txt : "option(BUILD_SHARED_LIBS "Build shared libraries instead of static ones" ON)"
**To Reproduce**
I compile with this script :
```rm -rf builddir && mkdir builddir && cd builddir
cmake \
-DCMAKE_TOOLCHAIN_FILE=cross_toolchain.txt \
-DCMAKE_INSTALL_PREFIX=/opt/jxl \
-DBUILD_SHARED_LIBS=ON \
-DJPEGXL_ENABLE_JNI:BOOL=FALSE \
-DJPEGXL_ENABLE_SKCMS:BOOL=FALSE \
-DBUILD_TESTING=OFF \
-DJPEGXL_FORCE_SYSTEM_BROTLI:BOOL=FALSE \
-DJPEGXL_FORCE_SYSTEM_HWY:BOOL=FALSE \
-G "Unix Makefiles" \
..
make -j7 install
```
**Expected behavior**
only shared library is built and installed, but
```
-- Installing: C:/Documents/msys2/opt/jxl/lib/libjxl-static.a
-- Installing: C:/Documents/msys2/opt/jxl/lib/libjxl_dec-static.a
-- Installing: C:/Documents/msys2/opt/jxl/lib/libjxl.dll.a
-- Installing: C:/Documents/msys2/opt/jxl/lib/libjxl.dll
```
**Environment**
- OS: [e.g. Windows] Windows
- Compiler version: [e.g. clang 11.0.1] gcc 10.3.0
- CPU type: [e.g. x86_64] x86_6
- cjxl/djxl version string: [e.g. cjxl [v0.3.7 | SIMD supported: SSE4,Scalar]]
| Windows (MSYS2+mingw-w64) -DBUILD_SHARED_LIBS:BOOL=TRUE does not disable static lib | https://api.github.com/repos/libjxl/libjxl/issues/714/comments | 4 | 2021-10-10T18:32:45Z | 2021-10-11T11:33:53Z | https://github.com/libjxl/libjxl/issues/714 | 1,022,058,481 | 714 |
[
"libjxl",
"libjxl"
] | afaict no special patches are needed for lcms in libjxl, so it should be ok to use the system version. right now i am using https://cgit.alxu.ca/gentoo-overlay.git/tree/media-libs/libjxl/files/system-lcms.patch, but I'm not sure if `target_link_libraries(lcms2 INTERFACE PkgConfig::LCMS)` works on cmake 3.10, also i think my interpretation of FORCE_SYSTEM was not consistent with the other usages. | Add LIBJXL_FORCE_SYSTEM_LCMS | https://api.github.com/repos/libjxl/libjxl/issues/712/comments | 7 | 2021-10-09T17:59:52Z | 2021-11-22T13:16:08Z | https://github.com/libjxl/libjxl/issues/712 | 1,021,768,462 | 712 |
[
"libjxl",
"libjxl"
] | As briefly discussed on Discord, Linux distros (and I assume other users too) will prefer to avoid bundled libraries. Even though it is only used in tools, people's crappy vulnerability scanners will probably pick it up. Also, even though you probably shouldn't pass untrusted input to cjxl, someone will probably do it anyways.
Avoiding bundled lodepng could look like:
1. System-wide lodepng: I don't think this is a supported configuration upstream.
2. Use libpng for regular PNGs as well as APNG.
3. Allow disabling PNG support. I think this is not preferred but still a reasonable configuration, since you can simply convert your image to PPM first. | Support compilation without bundled lodepng | https://api.github.com/repos/libjxl/libjxl/issues/711/comments | 3 | 2021-10-09T17:59:36Z | 2022-03-18T13:01:21Z | https://github.com/libjxl/libjxl/issues/711 | 1,021,768,417 | 711 |
[
"libjxl",
"libjxl"
] | This is CICP (H.273) value of 12 - I suspect more content is mastered for this color space thanks to Apple's DisplayP3 screens and OS support than it is for actual DCI-P3... | Color encoding ambiguities (missing D65 based P3 JxlPrimaries) | https://api.github.com/repos/libjxl/libjxl/issues/709/comments | 8 | 2021-10-08T10:29:00Z | 2021-11-18T09:29:26Z | https://github.com/libjxl/libjxl/issues/709 | 1,020,944,723 | 709 |
[
"libjxl",
"libjxl"
] | Hello,
This crash occurs when a Qt application decode more JXL files at the same time via my [qt-jpegxl-image-plugin](https://github.com/novomesk/qt-jpegxl-image-plugin)
During the crash I see following message:
`/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/image_ops.h:48: JXL_DASSERT: rect_from.IsInside(from)`
```
#0 jxl::Abort () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/base/status.cc:42
#1 0x00007fffe872f964 in jxl::CopyImageTo<float> () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/image_ops.h:48
#2 0x00007fffe8844075 in LoadBorders () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_cache.cc:110
#3 jxl::PassesDecoderState::FinalizeGroup () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_cache.cc:156
#4 0x00007fffe8863925 in jxl::N_AVX2::DecodeGroupImpl () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_group.cc:441
#5 0x00007fffe886458f in jxl::DecodeGroup () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_group.cc:754
#6 0x00007fffe8848f9d in jxl::FrameDecoder::ProcessACGroup () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_frame.cc:579
#7 0x00007fffe88490d5 in operator() () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_frame.cc:746
#8 CallDataFunc () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/base/data_parallel.h:88
#9 0x00007fffe8a011af in jpegxl::ThreadParallelRunner::RunRange () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/threads/thread_parallel_runner_internal.cc:139
#10 0x00007fffe8a012ab in jpegxl::ThreadParallelRunner::ThreadFunc () at /var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/threads/thread_parallel_runner_internal.cc:169
#11 0x00007ffff72b7e30 in std::execute_native_thread_routine (__p=0x7fffe0005390) at /var/tmp/portage/sys-devel/gcc-10.3.0-r2/work/gcc-10.3.0/libstdc++-v3/src/c++11/thread.cc:80
#12 0x00007ffff7f80e3e in start_thread () from /lib64/libpthread.so.0
#13 0x00007ffff6fd32cf in clone () from /lib64/libc.so.6
```
Here is a simple console application I am able to reproduce crash easily:
[sources.zip](https://github.com/libjxl/libjxl/files/7309663/sources.zip)
How to compile and run:
```
qmake test_crash.pro
make
```
The application decodes bucuresti2.jxl file in two threads (0 - main thread, 1 - worker thread). Each thread have different instance of the plug-in and each plug-in create own ParallelRunner.
It may not crash during first iteration, but sooner or later it crashes. The output may run like this:
```
./test_crash
Iteration: 0
[0] 10916x9985 count:1
[1] 10916x9985 count:1
Iteration: 1
[0] 10916x9985 count:1
[1] 10916x9985 count:1
Iteration: 2
[1] 10916x9985 count:1
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/image_ops.h:48: JXL_DASSERT: rect_from.IsInside(from)
Neprípustná inštrukcia
```
Sometime it crashes immediately:
```
Iteration: 0
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/image_ops.h:48: JXL_DASSERT: rect_from.IsInside(from)
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/image_ops.h:48: JXL_DASSERT: rect_from.IsInside(from)
Neprípustná inštrukcia
```
When just one thread with plug-in is running at a time, there is no crash. | Crash during multiple concurrent/parallel decoding | https://api.github.com/repos/libjxl/libjxl/issues/708/comments | 9 | 2021-10-08T08:45:08Z | 2021-11-01T10:36:28Z | https://github.com/libjxl/libjxl/issues/708 | 1,020,849,009 | 708 |
[
"libjxl",
"libjxl"
] | [jxl_info.zip](https://github.com/libjxl/libjxl/files/7303233/jxl_info.zip) contains **bucuresti2.jxl** file.
It was encoded via following command:
`cjxl 10921852336_28ebe2249c_o.jpg bucuresti2.jxl -p --centerfirst -d 10 --num_threads=2 --strip -e 5`
When I use **jxlinfo**, I get some error:
```
jxlinfo bucuresti2.jxl
dimensions: 10916x9985
have_container: 0
uses_original_profile: 0
bits_per_sample: 8
have_preview: 0
have_animation: 0
orientation: 1 (Normal)
num_color_channels: 3
num_extra_channels: 0
color profile:
format: JPEG XL encoded color profile
color_space: 0 (RGB color)
white_point: 1 (D65)
primaries: 1 (sRGB)
transfer_function: 13 (sRGB)
rendering_intent: 1 (Relative)
frame:
still frame, unnamed
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/passes_state.cc:55: JXL_FAILURE: kUseDcFrame specified for dc_level 0, but no frame was decoded with level 1
/var/tmp/portage/media-libs/libjxl-9999/work/libjxl-9999/lib/jxl/dec_frame.cc:289: JXL_RETURN_IF_ERROR code=1: InitializePassesSharedState(frame_header_, &dec_state_->shared_storage)
Decoder error
``` | error printed by jxlinfo | https://api.github.com/repos/libjxl/libjxl/issues/699/comments | 5 | 2021-10-07T12:26:05Z | 2021-10-14T15:56:36Z | https://github.com/libjxl/libjxl/issues/699 | 1,019,984,448 | 699 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
I am packaging libjxl for Alpine Linux. Some tests failing, but I am unsure of the cause.
**To Reproduce**
Build libjxl on Alpine Linux and run tests.
**Expected behavior**
Successful build and tests.
**Environment**
- OS: Alpine Linux
- Compiler version: gcc 10.3.1_git20210921-r1 (see https://git.alpinelinux.org/aports/tree/main/gcc for details), musl 1.2.2
- CPU type: aarch64, ppc64le, s390x, x86 (32-bit, 64-bit is ok)
- libjxl version: 0.6
**Additional context**
For x86, the test suite requires `-msse -mfpmath=sse` in order to pass. For aarch64, ppc64le, and s390x, three tests fail in identical ways: RobustStatisticsTest.TestMode, RobustStatisticsTest.CleanLine, and DecodeTest.PixelTestWithICCProfileLossy. The last one affects all archs and is tracked as #500 already.
<details><summary>aarch64, ppc64le, and s390x failing test outputs (identical except for duration)</summary>
```
[ RUN ] RobustStatisticsTest.TestMode
===========================frac 1
hsm 10.0 hrm 9 argmax 9.0 median 9.999786
1510 1761 1805 1810 1611
===========================frac 2
hsm 20.0 hrm 19 argmax 19.0 median 19.999693
1206 1227 1335 1310 1222
===========================frac 3
hsm 30.0 hrm 29 argmax 29.0 median 29.999731
1079 1092 1109 1110 1004
===========================frac 4
hsm 40.0 hrm 40 argmax 40.0 median 39.999756
895 937 956 916 850
===========================frac 5
hsm 49.0 hrm 49 argmax 49.0 median 49.999603
771 884 870 844 791
===========================frac 6
hsm 60.0 hrm 60 argmax 60.0 median 59.999840
768 756 785 768 723
===========================frac 7
/builds/alxu/aports/testing/libjxl/src/libjxl-0.6/lib/jxl/robust_statistics_test.cc:75: Failure
Value of: is_near(hsm, argmax) || is_near(hsm, median)
Actual: false
Expected: true
hsm 69.0 hrm 69 argmax 70.0 median 69.999565
708 703 736 691 670
===========================frac 8
hsm 79.0 hrm 79 argmax 79.0 median 79.999634
655 692 700 700 616
===========================frac 9
hsm 90.0 hrm 90 argmax 90.0 median 90.000053
617 656 637 662 614
[ FAILED ] RobustStatisticsTest.TestMode (41 ms)
```
```
[ RUN ] RobustStatisticsTest.CleanLine
x 2319.072266 slope=0.60 b=2.00 max_l1 0.000002 mad 0.000000
/builds/alxu/aports/testing/libjxl/src/libjxl-0.6/lib/jxl/robust_statistics_test.cc:132: Failure
Expected: (max_l1) <= (max_l1_limit), actual: 1.90735e-06 vs 1e-06
[ FAILED ] RobustStatisticsTest.CleanLine (3 ms)
```
</details>
I looked into this, but couldn't find any obvious culprits. I know that many floating-point functions return different results with different implementations, but it seems that these tests use only basic arithmetic, comparisons, and implicit comparisons (std::max, std::nth_element, etc), which should return identical results on all implementations.
Let me know what additional information is needed. | RobustStatisticsTest failing on Alpine aarch64, ppc64le, s390x | https://api.github.com/repos/libjxl/libjxl/issues/698/comments | 1 | 2021-10-07T06:39:24Z | 2021-10-08T18:15:42Z | https://github.com/libjxl/libjxl/issues/698 | 1,019,672,961 | 698 |
[
"libjxl",
"libjxl"
] | Using query.png (grayscale-16bits) - 250ko
cjxl query.png output.jxl -d 1.0
this command give 1ko very visually lossy result (approximately 1ko) | Wrong grayscale-16bits lossy encoding result | https://api.github.com/repos/libjxl/libjxl/issues/695/comments | 9 | 2021-10-06T14:00:10Z | 2021-11-19T17:07:26Z | https://github.com/libjxl/libjxl/issues/695 | 1,018,389,528 | 695 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
I'm trying to encode image with intensity_target set to 10000.0f but output image is always set to 255.0f
**To Reproduce**
int test2()
{
LOG_D("...");
int err = 0;
float bufferData[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
uint32_t bufferDataSize = sizeof(bufferData);
uint32_t version = JxlEncoderVersion();
JxlEncoderStatus jxl_sts = JXL_ENC_SUCCESS;
JxlDataType jxl_datatype = JXL_TYPE_FLOAT;
JxlPixelFormat jxl_pixfmt;
memset(&jxl_pixfmt, 0, sizeof(JxlPixelFormat));
jxl_pixfmt.num_channels = 3;
jxl_pixfmt.data_type = jxl_datatype;
jxl_pixfmt.endianness = JXL_NATIVE_ENDIAN;
jxl_pixfmt.align = 0;
JxlBasicInfo jxl_info;
memset(&jxl_info, 0, sizeof(JxlBasicInfo));
jxl_info.xsize = 2;
jxl_info.ysize = 2;
jxl_info.bits_per_sample = 32;
jxl_info.exponent_bits_per_sample = 8;
jxl_info.intensity_target = 10000.0f;
jxl_info.min_nits = 0.0f;
jxl_info.relative_to_max_display = 0;
jxl_info.linear_below = 0.0f;
jxl_info.alpha_bits = 0;
jxl_info.uses_original_profile = JXL_TRUE;
jxl_sts = JxlEncoderSetBasicInfo(jxl_enc, &jxl_info);
if (jxl_sts != JXL_ENC_SUCCESS) {
LOG_E("Failed. JxlEncoderSetBasicInfo.");
return 1;
}
JxlColorEncoding jxl_color;
memset(&jxl_color, 0, sizeof(JxlColorEncoding));
JxlColorEncodingSetToLinearSRGB(&jxl_color, JXL_FALSE);
jxl_color.primaries = JXL_PRIMARIES_2100;
jxl_color.primaries_red_xy[0] = 0.708f;
jxl_color.primaries_red_xy[1] = 0.292f;
jxl_color.primaries_green_xy[0] = 0.17f;
jxl_color.primaries_green_xy[1] = 0.797f;
jxl_color.primaries_blue_xy[0] = 0.131f;
jxl_color.primaries_blue_xy[1] = 0.046f;
jxl_color.transfer_function = JXL_TRANSFER_FUNCTION_PQ;
jxl_sts = JxlEncoderSetColorEncoding(jxl_enc, &jxl_color);
if (jxl_sts != JXL_ENC_SUCCESS) {
LOG_E("Failed. JxlEncoderSetColorEncoding.");
return 1;
}
JxlEncoderOptions* jxl_options = JxlEncoderOptionsCreate(jxl_enc, nullptr);
JxlEncoderOptionsSetLossless(jxl_options, JXL_TRUE);
jxl_sts = JxlEncoderAddImageFrame(jxl_options, &jxl_pixfmt, reinterpret_cast<void*>(bufferData), bufferDataSize);
if (jxl_sts != JXL_ENC_SUCCESS) {
LOG_E("Failed. JxlEncoderAddImageFrame.");
return 1;
}
uint8_t* buf_off = buf_out;
size_t size_avail = size_out;
jxl_sts = JXL_ENC_NEED_MORE_OUTPUT;
while (jxl_sts == JXL_ENC_NEED_MORE_OUTPUT) {
LOG_D("[%u][%p][%zu]", jxl_sts, buf_off, size_avail);
jxl_sts = JxlEncoderProcessOutput(jxl_enc, &buf_off, &size_avail);
LOG_D("[%u][%p][%zu]", jxl_sts, buf_off, size_avail);
if (jxl_sts == JXL_ENC_NEED_MORE_OUTPUT) {
size_t off = buf_off - buf_out;
LOG_D("[%zu]", off);
recreateOutput(size_out * 2);
buf_off = buf_out + off;
size_avail = size_out - off;
}
}
size_out = (size_t)(buf_off - buf_out);
LOG_D("[size:%zuB]", size_out);
if (storeOutput(consoleargs->filename_output)) {
LOG_E("Failed.");
return 1;
}
LOG_D("Done.");
return 0;
}
**Expected behavior**
Checking image format with jxlinfo outputImage.jxl should display
xsize: 2
ysize: 2
have_container: 0
uses_original_profile: 1
bits_per_sample: 32
exponent_bits_per_sample: 8
intensity_target: 10000.000000
min_nits: 0.000000
relative_to_max_display: 0
linear_below: 0.000000
have_preview: 0
have_animation: 0
orientation: 1
num_extra_channels: 0
alpha_bits: 0
alpha_exponent_bits: 0
alpha_premultiplied: 0
color profile:
format: JPEG XL encoded color profile
color_space: 0
white_point: 1
white_point XY: 0.312700 0.329000
primaries: 9
red primaries XY: 0.708000 0.292000
green primaries XY: 0.170000 0.797000
blue primaries XY: 0.131000 0.046000
transfer_function: 16
rendering_intent: 1
**Screenshots**
Github doesn't allow upload of *.jxl files so I renamed extension to *.txt and uploaded as attachment
**Environment**
- OS: Windows 10
- Compiler version: Visual Studio 2017
- CPU type: x86_64
- JxlEncoderVersion(); returns 5000
**Additional context**
Add any other context about the problem here.
[output.txt](https://github.com/libjxl/libjxl/files/7294408/output.txt)
| Can't set intensity_target of encoded image | https://api.github.com/repos/libjxl/libjxl/issues/694/comments | 1 | 2021-10-06T13:48:46Z | 2021-10-18T16:13:38Z | https://github.com/libjxl/libjxl/issues/694 | 1,018,366,814 | 694 |
[
"libjxl",
"libjxl"
] | **Describe the bug**
The encoding/decoding process fails with ppm images with 10 bit-depth. While the encoding step seems fine, the decoder fails to decode with "Failed to write decoded image.".
**To Reproduce**
Steps to reproduce the behavior:
cjxl sideboard.ppm sideboard.jxl -d 0.0 --num_threads=8 -e 9
djxl sideboard.jxl sideboard_dec.ppm
Happens with various configurations of the encoder, both for lossless and lossy compression. See the attachment for an example of an image for which the problem occurs: [testimage.zip](https://github.com/libjxl/libjxl/files/7293765/testimage.zip).
**Expected behavior**
The codec should be able to encode and decode ppm images of any bit-depth.
**Environment**
- OS: Ubuntu 20.04
- Compiler version: clang 10.0.0-4ubuntu1
- CPU type: x86_64
- cjxl/djxl version string: cjxl v0.7.0 0c5cf04 [AVX2,SSE4,Scalar]
**Additional context**
The usual header of a 10 bit-depth ppm image should be: P6 WIDTH HEIGHT 1023. However, if I edit this header to replace 1023 with 65535 (which should mean that the maximum image value is 65535), everything works fine. The format specification, available at http://netpbm.sourceforge.net/doc/ppm.html, states that the maxval parameter should represent: "The maximum color value (Maxval), again in ASCII decimal. Must be less than 65536 and more than zero.".
| Problem encoding/decoding ppm images with but-depth larger that 8 and lower than 16. | https://api.github.com/repos/libjxl/libjxl/issues/692/comments | 1 | 2021-10-06T12:47:41Z | 2022-03-31T12:44:21Z | https://github.com/libjxl/libjxl/issues/692 | 1,018,255,091 | 692 |
[
"libjxl",
"libjxl"
] | I have a log of pictures with russian, japanese and chinese filenames.
Examples: 3d-art-красивые-картинки-art-пираты-6497178.jpeg or фото-Природа-озеро-горы-6946340.jpeg
When I rename them using the CMD shell:
ren фото-Природа-озеро-горы-6946340.jpeg 00000temp.jpeg
I can convert them and rename it back afterwards. See attached screenshot.
It does not happen für typical WESTERN unicode filenames with German Umlaut like ÖÄÜ.

That exact source picture on the internet:
http://joyreactor.cc/post/4943227
Cannot test that for *nix, don't have a linux at home any more (last was about 2015). But since the normale cmd copy / xcopy / robocopy and all other windows command line tools can handle it it should be possible for the windows version of CJXL too.
kind regards,
Joachim Otahal
| Windows cjxl.exe cannot handle Japenes/Chinese/Russian unicode filenames | https://api.github.com/repos/libjxl/libjxl/issues/683/comments | 50 | 2021-10-03T17:13:08Z | 2024-10-17T08:42:08Z | https://github.com/libjxl/libjxl/issues/683 | 1,014,464,149 | 683 |
[
"libjxl",
"libjxl"
] | Hello JXL developers!
Situation: The nice 48 bit full-size original tif(s) at: https://noirlab.edu/public/images/iotw2135a/
Target: .jxl it.
But I can't. .TIF input is not supported. But most space related sites use .TIF in 24 or 48 bit.
Current workaround: Using Affinity Photo to convert it to 48 bit .PNG, and then use cjxl.exe.
BTW: I love the transcoding-jpeg-lossless feature.
kind regards,
Joachim Otahal | Please include .TIF (24 bit and 48 bit) as possible input. | https://api.github.com/repos/libjxl/libjxl/issues/680/comments | 5 | 2021-10-02T12:34:44Z | 2021-11-19T08:42:26Z | https://github.com/libjxl/libjxl/issues/680 | 1,014,037,001 | 680 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.