LibRaw 0.22 PreRC1

LibRaw 0.22 PreRC1 is just published in our Github repository. Here are changes relative to 202502 snapshot:

Camera support

  • Canon EOS R1, EOS R5 Mark II
  • Fujifilm X-T50, GFX 100S II
  • Leica Q3 43, D-Lux8
  • Nikon Z6-III (no HE/HE* support)
  • Panasonic GH7, S9
  • Sony ZV-E10M2, UMC-R10C

Big changes/API changes

  • New implementation for Samsung V3 decoder (NX1, NX500, etc)
  • Canon AutoRotate mode detection for several cameras.
    If LIBRAW_RAWOPTIONS_CANON_CHECK_CAMERA_AUTO_ROTATION_MODE bit is set in imgdata.rawparams: for shots with AutoRotate is Off TIFF::Orientation tag wil be used for imgdata.sizes.flip (and Makernotes rotation tag for other AutoRotate modes).
    Note: AutoRotate is detected for limited set of Canon cameras, namely: EOS 6D, 5D Mark IV, 5DS, 5DS R
    To extend this list: we need specially shot samples to detect AutoRotate field location in metadata. Contact us for details if you need to add your camera to list and have such camera on hands
  • New rawoptions/processing flag for DNG processing if compiled with Adobe DNG SDK:
    LIBRAW_RAWOPTIONS_DNG_STAGE23_IFPRESENT_JPGJXL
    Similar to LIBRAW_RAWOPTIONS_DNG_STAGE2_IFPRESENT,LIBRAW_RAWOPTIONS_DNG_STAGE3_IFPRESENT flags but applied to JPEG/JPEG-XL compressed images only:
    If OpcodeList2/OpcodeList3 tags are present in the input DNG file, these tags will be processed via Adobe DNG SDK, producing corrected (de-bayered) image.
  • LibRaw::adjust_to_raw_inset_crop exposed via C-API call: libraw_adjust_to_raw_inset_crop(libraw_data_t *lr, unsigned mask, float maxcrop); Note: default maxcrop value for C++ API is 0.55f
  • DNG OpcodeList1/2/3: opcode list(s) are read (as is) into imgdata.color.dng_levels.rawopcodes[3]

Minor fixes/improvemtns

  • Fixed issue 712: mistype in MIN/MAX that loosens camera WB preset checks
  • Updated libraw_types.h to fix calling C++ files in external C -- main includes cannot be in extern C for the library to correctly compile under Swift Modules. This small change lets the compiler finish when compiling the library inside a module.
  • Read known parts of the X3F 4.X (Quattro) header
  • Rollei loader: more realistic limits
  • Additional metadata checks in PhaseOne files processing
  • Multiple minor fixes to better handling of specially crafted files
  • Fixed regression in Fujufilm S6000/S6500 support
  • Support for 4-color lossy-compressed DNG files
  • Improved damaged/incorrect/modified CR3 files handling
  • Colordata updated for several Fujifilm cameras
  • Improved byte order detection for PowerPC
  • NOMINMAX defined before #include winsock2.h in LibRaw public header to not provide min/max macros to the code that includes libraw.h

Comments

Wrong color with fujifilm x-t50

Hello i noticed a weird situation with libraw recently i found this raw file which renders with pale and desaturated red color! a different shade of color for other fuji Raf files i have not noticed such thing also tried different params yet always returned the same weird red color the thing is i test the same image with almost many many image processing software from rawtherapee to lightroom even rapid raw and raproc they all rendered the image as the jpeg colors except when used libraw with different setting and params we got the same pale here is the link to the image, i shall say i tested both the master branch and even 0.21.4 !
https://johnricardstock.photoshelter.com/dnld-hires/DSCF5078.RAF?dl_id=A...|e

cam_xyz and rgb_cam not populated for X-T5 and X-T50 cameras

Hello again Alex , these logs might help with the situation this happens for the RAF files that have this
matrices as so! but i see that in the source there is this line in the colordata.cpp

  { LIBRAW_CAMERAMAKER_Fujifilm, "X-T5", 0, 0,  // same CMs: X-T5 and X-T50
    { 11809,-5358,-1141,-4248,12164,2343,-514,1097,5848 } },

i am on this commit : HEAD is now at 3733457d imported 0.22-PreRC1

and this is what i get but shouldn't automatically these matrices be populated
[2025-11-14 12:54:13.048] [warning] BEFORE_CALLING_UNPACK
--- cam_xyz ---
0       0       0
0       0       0
0       0       0
0       0       0
--- cmatrix ---
0       0       0       0
0       0       0       0
0       0       0       0
--- rgb_cam ---
1       0       0       0
0       1       0       0
0       0       1       0
--- pre_mul ---
1       1       1       0
--- cam_mul ---
596     302     541     0
 
[2025-11-14 12:54:13.102] [warning] AFTER_CALLING_UNPACK
--- cam_xyz ---
0       0       0
0       0       0
0       0       0
0       0       0
--- cmatrix ---
0       0       0       0
0       0       0       0
0       0       0       0
--- rgb_cam ---
1       0       0       0
0       1       0       0
0       0       1       0
--- pre_mul ---
1       1       1       0
--- cam_mul ---
596     302     541     0
[2025-11-14 12:54:13.108] [info] flip: 0
[2025-11-14 12:54:13.108] [warning] DID NOT FOUND A VALID cam_xyz MATRIX
[2025-11-14 12:54:20.715] [warning] AFTER_CALLING_DC_RAW_PROCESS
--- cam_xyz ---
0       0       0
0       0       0
0       0       0
0       0       0
--- cmatrix ---
0       0       0       0
0       0       0       0
0       0       0       0
--- rgb_cam ---
1       0       0       0
0       1       0       0
0       0       1       0
--- pre_mul ---
1.97351 1       1.79139 1
--- cam_mul ---
596     302     541     0
[2025-11-14 12:54:20.719] [info] dcraw_process completed successfully

also what is the relation between cam_xyz and rgb_cam? can we populate the rgb_cam from cam_xyz? i am asking does the data from colordata.cpp is the cam_xyz?

  { LIBRAW_CAMERAMAKER_Fujifilm, "X-T5", 0, 0,  // same CMs: X-T5 and X-T50
    { 11809,-5358,-1141,-4248,12164,2343,-514,1097,5848 } },

how does libraw knows what color_xyz shall be used ?
i tried to set use_camera_matrix with different values from 0 - 3 always same colors! so i might need some help here cause i got really confused . thanks.