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 93b12ad..5e9127c 100644 --- a/src/content/photos/picos-de-europa/index.en.mdx +++ b/src/content/photos/picos-de-europa/index.en.mdx @@ -16,7 +16,6 @@ import image2 from "images/PXL_20250601_132646197.jpg" import image3 from "images/PXL_20250601_124002445.jpg" import image4 from "images/PXL_20250601_095307910.jpg" import image5 from "images/PXL_20250601_082528934.jpg" -import image6 from "images/PXL_20250601_044050514.mp4" import image7 from "images/PXL_20250530_195122211.jpg" import image8 from "images/PXL_20250530_170114907.MP.jpg" import image9 from "images/PXL_20250530_141432767.jpg" @@ -24,14 +23,12 @@ import image10 from "images/PXL_20250530_135631186.MP.jpg" import image11 from "images/PXL_20250530_110041174.jpg" import image12 from "images/PXL_20250530_082919731.jpg" import image13 from "images/PXL_20250529_201559403.jpg" -import image14 from "images/PXL_20250529_125633973.mp4" import image15 from "images/PXL_20250528_121633744.MP.jpg" import image16 from "images/PXL_20250527_101057540.MP.jpg" import image17 from "images/PXL_20250527_100728883.jpg" import image18 from "images/IMG-20250531-WA0020.jpeg" import image19 from "images/20250528_164715.jpg" -import image20 from "images/PXL_20250602_064236132.mp4" import image21 from "images/PXL_20250602_064221551.jpg" import image22 from "images/PXL_20250603_083830771.jpg" import image23 from "images/PXL_20250603_093606665.jpg" @@ -45,9 +42,8 @@ import image27 from "images/PXL_20250605_100650266.jpg" - -import videoUrl1 from "images/PXL_20250529_125633973_small_x265.mp4?url" +import videoUrl1 from "images/PXL_20250529_125633973_small_x265.mp4"