fix: some image loading

This commit is contained in:
Max Richter
2025-10-24 13:43:34 +02:00
parent 6f7d1ff273
commit 25747157a1
11 changed files with 120 additions and 92 deletions

View File

@@ -15,12 +15,12 @@ interface Props {
}
async function checkImage(image: ImageMetadata) {
const src = image.src;
const src = typeof image === "string" ? image : image.src;
if (!src) return false;
try {
if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true;
const res = await inferRemoteSize(src);
if (res.format) {
console.log(res)
image.format = res.format;
return true;
} else {