Skip to content

inferSize fails with certain remote image URLs with Astro's Picture component #17263

Description

@paulrudy

Astro Info

Astro                    v7.0.5
Vite                     v8.1.2
Node                     v22.20.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When using Astro's Picture component with a remote URL and inferSize, this Wikimedia image URL fails with the error: [ERROR] [FailedToFetchRemoteImageDimensions] Failed to get the dimensions for <url>.

Using Astro's Image element with the same URL and inferSize does not cause any issue.

What's the expected result?

Astro's Picture component should be able to infer a remote image's size whenever the Image component is able to.

Link to Minimal Reproducible Example

https://github.com/paulrudy/astro-picture-test

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)triage: fix verifiedReporter confirmed the triage bot fix works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions