diff --git a/src/content/docs/en/reference/modules/astro-assets.mdx b/src/content/docs/en/reference/modules/astro-assets.mdx index 52de5ee406d98..ef29c6a60b926 100644 --- a/src/content/docs/en/reference/modules/astro-assets.mdx +++ b/src/content/docs/en/reference/modules/astro-assets.mdx @@ -297,6 +297,8 @@ import { Image } from 'astro:assets'; As of Astro 5.17.3, `inferSize` only fetches dimensions for [authorized remote image domains](/en/guides/images/#authorizing-remote-images). Remote images outside the allowlist are not fetched. +As of Astro 7.4.0, if fetching the remote image fails because of a transient network error (e.g. a connection reset, DNS lookup failure, or timeout), Astro will automatically retry the request up to two more times before failing. + #### `priority`

@@ -674,13 +676,15 @@ const optimizedBackground = await getImage({src: myBackground, format: 'avif'})

-A function to set the original `width` and `height` of a remote image automatically. This can be used as an alternative to passing the [`inferSize` ](#infersize) property. +A function to set the original `width` and `height` of a remote image automatically. This can be used as an alternative to passing the [`inferSize`](#infersize) property. ```ts import { inferRemoteSize } from 'astro:assets'; const { width, height } = await inferRemoteSize("https://example.com/cat.png"); ``` +As of Astro 7.4.0, `inferRemoteSize()` automatically retries transient network errors in the same way as [`inferSize`](#infersize). + ### `getConfiguredImageService()`

@@ -1259,20 +1263,7 @@ const origParams = getOrigQueryParams(url.searchParams);

-Infers the dimensions of a remote image by streaming its data and analyzing it progressively until sufficient metadata is available. - -```ts -import { inferRemoteSize } from 'astro/assets/utils'; - -const remoteImageUrl = 'https://example.com/image.jpg'; -const imageSize = await inferRemoteSize(remoteImageUrl); -// Example value: -// { -// width: 1920, -// height: 1080, -// format: 'jpg' -// } -``` +See [`inferRemoteSize()` in `astro:assets`](#inferremotesize) for more details. ### `propsToFilename()`