Skip to content

Commit

Permalink
use MC=6 for sRGB because of potential incompatibility of Safari/iOS …
Browse files Browse the repository at this point in the history
…with MC=5 (#1017)
  • Loading branch information
farindk committed Oct 30, 2023
1 parent d5a5559 commit 4809d30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/heif_enc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ std::string chroma_downsampling;

uint16_t nclx_colour_primaries = 1;
uint16_t nclx_transfer_characteristic = 13;
uint16_t nclx_matrix_coefficients = 5;
uint16_t nclx_matrix_coefficients = 6;
int nclx_full_range = true;

std::string property_pitm_description;
Expand Down
4 changes: 2 additions & 2 deletions libheif/nclx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void color_profile_nclx::set_default()
// sRGB defaults
m_colour_primaries = 1;
m_transfer_characteristics = 13;
m_matrix_coefficients = 5;
m_matrix_coefficients = 6;
m_full_range_flag = true;
}

Expand Down Expand Up @@ -345,7 +345,7 @@ void color_profile_nclx::set_from_heif_color_profile_nclx(const struct heif_colo
void color_profile_nclx::replace_undefined_values_with_sRGB_defaults()
{
if (m_matrix_coefficients == heif_matrix_coefficients_unspecified) {
m_matrix_coefficients = heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G;
m_matrix_coefficients = heif_matrix_coefficients_ITU_R_BT_601_6;
}

if (m_colour_primaries == heif_color_primaries_unspecified) {
Expand Down

1 comment on commit 4809d30

@kleisauke
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line probably needs to be updated as well:

profile->matrix_coefficients = heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G; // 5

Please sign in to comment.