function getPngSize(url) {
const xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
xhr.responseType = "arraybuffer";
xhr.send();
const d = new DataView(xhr.response);
if (xhr.status !== 200 || d.getUint32(0) !== 0x89504E47) return null;
const width = d.getUint32(16, false);
const height = d.getUint32(20, false);
return { width, height };
}