JPG lossless transcode and progressive decoding

Issue description

If the user attempts to lossless transcode a JPG to JXL, and tries to use -p parameter (progressive decoding)...

Example 1

Command: cjxl -p in.jpg out.jxl
Result: Lossy compression is used, but the user may expect a lossless transcode, since by default lossless compression is used for already lossy input.

Example 2

Command: cjxl -d 0 -p in.jpg out.jxl
Result: Instead of JPEG, lossless transcode, it becomes Modular, lossless. The user will not be able to get back the original JPG.

Example 3

Command: cjxl -q 100 -p in.jpg out.jxl
Result: Same as Example 1, VarDCT, d1.000 is used, i.e. not the lossless compression as the user expected. Just like #126 (closed) but JPG input is affected as well?

Example 4

Command: cjxl -q 100 -m -p in.jpg out.jxl
Result: Same as Example 2.

Expected result

Is progressive decoding compatible with JPG lossless transcode?

If progressive decoding cannot be used with JPG lossless transcode, a message / error / warning should be displayed.

Environment

JPEG XL software version: 0.3

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information