Skip to content

Commit 44ff166

Browse files
committed
fix: defer baseline tile loading removal until image dimensions are known
1 parent c516ecf commit 44ff166

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/demo-page.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@ async function loadBaseline(source) {
427427
// passthrough path doesn't set X-Transcode-Source-* headers (because no
428428
// transform was attempted), so we measure from the loaded image instead.
429429
// We'll fill these in once the image loads.
430-
tile.classList.remove('loading');
431-
432430
tile.dataset.path = path;
433431
tile.dataset.size = String(result.size);
434432
tile.dataset.cache = cache;
@@ -443,6 +441,7 @@ async function loadBaseline(source) {
443441
img.onload = () => {
444442
tile.dataset.sourceW = String(img.naturalWidth);
445443
tile.dataset.sourceH = String(img.naturalHeight);
444+
tile.classList.remove('loading');
446445
const heading = tile.querySelector('h2');
447446
heading.innerHTML = \`Original source <span style="color: var(--text-dim); font-weight: 400; font-size: 13px;">\${img.naturalWidth} × \${img.naturalHeight}</span>\`;
448447
const meta = tile.querySelector('.baseline-meta');

0 commit comments

Comments
 (0)