2 Commits
Author SHA1 Message Date
Djeex f7ec358378 Merge pull request 'Chrome HDR artefacting fix' (#25) from dev into main
Reviewed-on: #25
2026-08-16 14:26:28 +02:00
DjeexandClaude Sonnet 5 2185aba135 Chrome HDR artefacting fix
Chrome's GPU rasterizer tiles large composited layers, and a lingering
will-change: transform keeps an image promoted to one of those layers
indefinitely — on HDR gain-map photos scaled down to fit the page,
that can leave visible seam lines at the tile boundaries. Drop the
hint once the fade transition actually ends so the image reverts to
normal (non-promoted) painting afterwards.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-16 14:12:07 +02:00
+8
View File
@@ -32,6 +32,14 @@ window.addEventListener("DOMContentLoaded", () => {
img.classList.add("loaded"); img.classList.add("loaded");
}; };
// Chrome HDR artefacting fix
const clearWillChange = (e) => {
if (e.propertyName !== "transform") return;
img.style.willChange = "auto";
img.removeEventListener("transitionend", clearWillChange);
};
img.addEventListener("transitionend", clearWillChange);
if (img.complete && img.naturalHeight !== 0) { if (img.complete && img.naturalHeight !== 0) {
onLoad(); // already loaded onLoad(); // already loaded
} else { } else {