pub unsafe extern "C" fn JxlDecoderSetKeepOrientation(
    dec: *mut JxlDecoder,
    skip_reorientation: c_int
) -> JxlDecoderStatus
Expand description

Enables or disables preserving of as-in-bitstream pixeldata orientation. Some images are encoded with an Orientation tag indicating that the decoder must perform a rotation and/or mirroring to the encoded image data.

  • If skip_reorientation is JXL_FALSE (the default): the decoder will apply the transformation from the orientation setting, hence rendering the image according to its specified intent. When producing a JxlBasicInfo, the decoder will always set the orientation field to JXL_ORIENT_IDENTITY (matching the returned pixel data) and also align xsize and ysize so that they correspond to the width and the height of the returned pixel data.
  • If skip_reorientation is JXL_TRUE: the decoder will skip applying the transformation from the orientation setting, returning the image in the as-in-bitstream pixeldata orientation. This may be faster to decode since the decoder doesn’t have to apply the transformation, but can cause wrong display of the image if the orientation tag is not correctly taken into account by the user.

By default, this option is disabled, and the returned pixel data is re-oriented according to the image’s Orientation setting.

This function must be called at the beginning, before decoding is performed.

@see JxlBasicInfo for the orientation field, and @ref JxlOrientation for the possible values.

@param dec decoder object @param skip_reorientation JXL_TRUE to enable, JXL_FALSE to disable. @return @ref JXL_DEC_SUCCESS if no error, @ref JXL_DEC_ERROR otherwise.