Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/jpegrutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ uhdr_error_info_t getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, uint8_t
metadata->offset_hdr[c] = 0.0f;
}
metadata->hdr_capacity_min = 1.0f;
// Apple applies the gain map in the base image's color space, and its gain-map
// image carries no ICC profile.
metadata->use_base_cg = true;

float max_content_boost;
bool present = false;
Expand Down
1 change: 1 addition & 0 deletions tests/jpegr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ TEST(JpegRTest, decodeApple) {
}
EXPECT_EQ(gainmapMetadata->hdr_capacity_min, 1.0f);
EXPECT_FLOAT_EQ(gainmapMetadata->hdr_capacity_max, headroom);
EXPECT_TRUE(gainmapMetadata->use_base_cg);

uhdr_release_decoder(dec);
}
Expand Down
Loading