JPXL preview in DNG, Adobe DNG SDK

I've integrated LibRaw with the Adobe DNG SDK, but it seems dcraw_make_mem_thumb() cannot be used to extract the embedded JPXL preview?

I can extract the embedded JPXL using ExifTool and save it to disk. The resulting JXL has 5472x3648 pixel and loads fine in Photoshop and Affinity. It looks like the "developed" DNG in ACR.

In my code, I do basically this:
...
plraw->set_dng_host(host.get());
plraw->imgdata.rawparams.use_dngsdk = LIBRAW_DNG_ALL;
plraw->imgdata.rawparams.options |= LIBRAW_RAWOPTIONS_ALLOW_JPEGXL_PREVIEWS;

plraw->open_file()
plraw->unpack_thumb()

libraw_processed_image_t* pthumb = plraw->dcraw_make_mem_thumb();

but dcraw_make_mem_thumb() returns null. When I do the same with e.g. a NEF file, dcraw_make_mem_thumb returns the embedded preview. I would expect that it returns the embedded JPXL preview?

Since dcraw_make_mem_thumb() returns null, I do the normal processing

plraw->unpack()
plraw->dcraw_process()
...

but that produces an image that looks quite different (darker, less contrast) than the embedded preview in the DNG.

Am I missing a step? Should plraw->dcraw_make_mem_thumb() not return the JPXL preview?

Forums: 

Unpacked JPEG XL thumbnail is

Unpacked JPEG XL thumbnail is available via imgdata.thumbnail (and .thumbs_list)

We'll improve dcraw_make_mem_thumb() to handle it too, although this is just another buffer allocation and as-is data copy for JPEG-XL case

-- Alex Tutubalin @LibRaw LLC

Thanks!

Thanks, Alex!

This saves on step. I was already fiddling with the imgdata.thumbnail.
I now need to figure out how to decode the JXL data into something my software can use. Looking at the JXL official library at the moment...