Skip to content

Commit 09ddfd5

Browse files
committed
Refine info panel metadata display and compare HUD layout
1 parent f566a10 commit 09ddfd5

6 files changed

Lines changed: 308 additions & 138 deletions

File tree

QuickView/ImageEngine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,9 @@ void ImageEngine::FastLane::QueueWorker() {
11081108
e.metadata.Width = rawFrame.width;
11091109
e.metadata.Height = rawFrame.height;
11101110
e.metadata.Format = info.format; // [Scout] Direct from PeekHeader
1111+
e.metadata.FormatDetails = rawFrame.formatDetails;
1112+
e.metadata.LoaderName = loaderName;
1113+
e.metadata.FileSize = info.fileSize;
11111114

11121115
// [v5.3] Metadata is now populated by LoadToFrame (Unified path)
11131116
// We don't call LoadToFrame with pMetadata in FastLane currently,

QuickView/ImageLoader.cpp

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6800,10 +6800,44 @@ static bool TryReadMetadataNative(LPCWSTR filePath, CImageLoader::ImageMetadata*
68006800

68016801
bool success = false;
68026802
if (jpeg_read_header(&cinfo, TRUE) == JPEG_HEADER_OK) {
6803+
pMetadata->Format = L"JPEG";
68036804
// [v10.0] Fix: Always extract dimensions natively to prevent WIC 2633px preview regression
68046805
pMetadata->Width = cinfo.image_width;
68056806
pMetadata->Height = cinfo.image_height;
68066807

6808+
// Fill JPEG format details even when there is no EXIF, so the Info Panel can show chroma/Q/progressive.
6809+
{
6810+
int q = GetJpegQualityFromBuffer(header.data(), header.size());
6811+
6812+
std::wstring sub;
6813+
if (cinfo.num_components == 3) {
6814+
int h0 = cinfo.comp_info[0].h_samp_factor;
6815+
int v0 = cinfo.comp_info[0].v_samp_factor;
6816+
int h1 = cinfo.comp_info[1].h_samp_factor;
6817+
int v1 = cinfo.comp_info[1].v_samp_factor;
6818+
int h2 = cinfo.comp_info[2].h_samp_factor;
6819+
int v2 = cinfo.comp_info[2].v_samp_factor;
6820+
6821+
if (h0 == 2 && v0 == 2 && h1 == 1 && v1 == 1 && h2 == 1 && v2 == 1) sub = L"4:2:0";
6822+
else if (h0 == 2 && v0 == 1 && h1 == 1 && v1 == 1 && h2 == 1 && v2 == 1) sub = L"4:2:2";
6823+
else if (h0 == 1 && v0 == 1 && h1 == 1 && v1 == 1 && h2 == 1 && v2 == 1) sub = L"4:4:4";
6824+
else sub = L"4:4:0";
6825+
} else if (cinfo.num_components == 1) {
6826+
sub = L"Gray";
6827+
}
6828+
6829+
wchar_t fmtBuf[64]{};
6830+
if (q > 0 && !sub.empty()) swprintf_s(fmtBuf, L"%s Q=%d", sub.c_str(), q);
6831+
else if (q > 0) swprintf_s(fmtBuf, L"Q=%d", q);
6832+
else if (!sub.empty()) swprintf_s(fmtBuf, L"%s", sub.c_str());
6833+
6834+
pMetadata->FormatDetails = fmtBuf;
6835+
if (jpeg_has_multiple_scans(&cinfo)) {
6836+
if (!pMetadata->FormatDetails.empty()) pMetadata->FormatDetails += L" ";
6837+
pMetadata->FormatDetails += L"Prog";
6838+
}
6839+
}
6840+
68076841
std::vector<uint8_t> iccData;
68086842

68096843
for (jpeg_saved_marker_ptr marker = cinfo.marker_list; marker; marker = marker->next) {
@@ -6828,7 +6862,7 @@ static bool TryReadMetadataNative(LPCWSTR filePath, CImageLoader::ImageMetadata*
68286862
}
68296863
}
68306864
jpeg_destroy_decompress(&cinfo);
6831-
return success;
6865+
return success || !pMetadata->FormatDetails.empty() || pMetadata->Width > 0;
68326866
}
68336867

68346868
// 2. WebP

QuickView/ImageLoader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ class CImageLoader {
392392
ComPtr<IWICImagingFactory> m_wicFactory;
393393

394394
// [JXL Global Runner] Static singleton
395+
static void* s_jxlRunner;
396+
static std::mutex s_jxlRunnerMutex;
395397

396398
// Specialized High-Performance Loaders
397399
HRESULT LoadThumbJPEG(LPCWSTR filePath, int targetSize, ThumbData* pData); // New TurboJPEG Scaled Loader

0 commit comments

Comments
 (0)