diff --git a/src/components/Image.astro b/src/components/Image.astro index fd264ab..332aa55 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -1,10 +1,10 @@ --- import type { ImageMetadata } from "astro"; import { Picture as AstroImage } from "astro:assets"; -import { inferRemoteSize } from 'astro/assets/utils'; +import { inferRemoteSize } from "astro/assets/utils"; import { generateThumbHash, getExifData } from "@helpers/image"; interface Props { - src: ImageMetadata & { fsPath?: string, src?: string }; + src: ImageMetadata & { fsPath?: string; src?: string }; alt: string; pictureClass?: string; class?: string; @@ -16,20 +16,20 @@ interface Props { async function checkImage(image: ImageMetadata) { const src = image.src; - if(!src) return false; + if (!src) return false; try { if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true; const res = await inferRemoteSize(src); if (res.format) { image.format = res.format; return true; - }else { + } else { console.log("Failed to load: ", src); } return false; } catch (err) { + console.log("\n"); console.log("Failed to fetch: ", src); - console.log(err) return false; } } @@ -43,7 +43,7 @@ const { maxWidth, } = Astro.props; -let thumbhash = hash && await generateThumbHash(image); +let thumbhash = hash && (await generateThumbHash(image)); const imageOk = await checkImage(image); let exif = imageOk && (await getExifData(image)); @@ -85,5 +85,5 @@ const sizes = [ .join(", ")}> - ) : undefined + ) : undefined } diff --git a/src/content/photos/picos-de-europa/index.en.mdx b/src/content/photos/picos-de-europa/index.en.mdx index 7a5e5f0..94b6ca8 100644 --- a/src/content/photos/picos-de-europa/index.en.mdx +++ b/src/content/photos/picos-de-europa/index.en.mdx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b8e5659131185af05c819c99d371a98dfec422449908c8be46992a1810088112 -size 2854 +oid sha256:c8dfa4e3f17136d17755dfcd8f4d6089872abd8eaa95a43a4a5875defa39b77f +size 2594 diff --git a/src/content/photos/picos-de-europa/index.mdx b/src/content/photos/picos-de-europa/index.mdx index d47c5b6..a73a796 100644 --- a/src/content/photos/picos-de-europa/index.mdx +++ b/src/content/photos/picos-de-europa/index.mdx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:032a32cb72546ee8ce85f30dfcd1fb5199548f9dd0e7d81b8736c74a2b1dd096 -size 2954 +oid sha256:7884c7de1ca1b9fefad7d72119db877fe3c016e9a8dee4ed0705b387e5d450d4 +size 2694