Decode images asynchronously

This commit is contained in:
Abdo 2025-09-04 23:51:40 +03:00
parent 5c4d2e87a1
commit 4f5a14ed54

View file

@ -10,6 +10,9 @@ export function allImagesLoaded(): Promise<void[]> {
}
function imageLoaded(img: HTMLImageElement): Promise<void> {
if (!img.getAttribute("decoding")) {
img.decoding = "async";
}
return img.complete
? Promise.resolve()
: new Promise((resolve) => {