diff --git a/libheif/api/libheif/heif.h b/libheif/api/libheif/heif.h index 17a0adc2b3..750e2149ca 100644 --- a/libheif/api/libheif/heif.h +++ b/libheif/api/libheif/heif.h @@ -2363,7 +2363,7 @@ struct heif_encoding_options // Set this to the NCLX parameters to be used in the output image or set to NULL // when the same parameters as in the input image should be used. - const struct heif_color_profile_nclx* output_nclx_profile; + struct heif_color_profile_nclx* output_nclx_profile; uint8_t macOS_compatibility_workaround_no_nclx_profile; diff --git a/libheif/context.cc b/libheif/context.cc index cfae6e9bce..7567b2fcce 100644 --- a/libheif/context.cc +++ b/libheif/context.cc @@ -1162,7 +1162,7 @@ Result> HeifContext::encode_image(const std::shared_p heif_encoding_options options = in_options; if (const auto* nclx = output_image_item->get_forced_output_nclx()) { - options.output_nclx_profile = nclx; + options.output_nclx_profile = const_cast(nclx); } Result> srcImageResult = output_image_item->convert_colorspace_for_encoding(pixel_image,