Skip to content

Commit c2bcde5

Browse files
committed
Fix AVIF HDR metadata regression and optimize Info Panel UI redundancy
1 parent 7998a0c commit c2bcde5

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

QuickView/ImageLoader.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,7 @@ static void ProbeHdrMetadataNative(LPCWSTR filePath, QuickView::HdrStaticMetadat
318318
if (decoder) {
319319
if (avifDecoderSetIOMemory(decoder, mapping.data(), mapping.size()) == AVIF_RESULT_OK) {
320320
if (avifDecoderParse(decoder) == AVIF_RESULT_OK) {
321-
pHdr->isHdr = (decoder->image->depth > 8);
322-
pHdr->primaries = MapCicpPrimaries((uint8_t)decoder->image->colorPrimaries);
323-
pHdr->transfer = MapCicpTransfer((uint8_t)decoder->image->transferCharacteristics);
324-
pHdr->isValid = true;
321+
PopulateAvifHdrStaticMetadata(decoder->image, pHdr);
325322
avifDecoderDestroy(decoder);
326323
return;
327324
}

QuickView/UIRenderer.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,14 +1743,22 @@ std::vector<InfoRow> UIRenderer::BuildGridRows(const CImageLoader::ImageMetadata
17431743
metadata.colorInfo.dataSpace == QuickView::PixelDataSpace::EncodedHdr ||
17441744
metadata.colorInfo.IsSceneLinear()) {
17451745
const std::wstring hdrSummary = BuildHdrSummary(metadata);
1746-
const std::wstring hdrDetail = BuildHdrDetail(metadata.hdrMetadata);
1747-
if (!hdrSummary.empty() || !hdrDetail.empty()) {
1746+
const std::wstring hdrDetailTooltip = BuildHdrDetail(metadata.hdrMetadata);
1747+
1748+
// Very minimal detail for the summary line: Only show GainMap Alt stops if present
1749+
std::wstring hdrSummaryDetail;
1750+
if (metadata.hdrMetadata.hasGainMap) {
1751+
const std::wstring altStops = FormatHdrStops(metadata.hdrMetadata.gainMapAlternateHeadroom);
1752+
if (!altStops.empty()) hdrSummaryDetail = L"Alt " + altStops;
1753+
}
1754+
1755+
if (!hdrSummary.empty() || !hdrDetailTooltip.empty()) {
17481756
rows.push_back({
17491757
L"\U0001F31F",
17501758
L"HDR",
17511759
hdrSummary.empty() ? L"Metadata" : hdrSummary,
1752-
hdrDetail,
1753-
hdrSummary + (hdrDetail.empty() ? L"" : L"\n" + hdrDetail),
1760+
g_runtime.ShowHdrDetailsExpanded ? L"" : hdrSummaryDetail,
1761+
hdrSummary + (hdrDetailTooltip.empty() ? L"" : L"\n" + hdrDetailTooltip),
17541762
TruncateMode::EndEllipsis,
17551763
false
17561764
});
@@ -2062,18 +2070,13 @@ namespace {
20622070
}
20632071

20642072
if (hdr.gainMapApplied) {
2065-
if (!summary.empty()) summary += L" ";
2066-
summary += L"[GainMap Applied]";
2073+
// Already handled by showing "Ultra HDR" or "Applied" in details
2074+
// Keep it simple for summary
20672075
} else if (hdr.hasGainMap) {
20682076
if (!summary.empty()) summary += L" ";
20692077
summary += L"[GainMap]";
20702078
}
20712079

2072-
if (metadata.colorInfo.IsSceneLinear()) {
2073-
if (!summary.empty()) summary += L" ";
2074-
summary += L"[Linear]";
2075-
}
2076-
20772080
return summary;
20782081
}
20792082

0 commit comments

Comments
 (0)