Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image widths #12826

Open
1 task
wildfiremedia opened this issue Dec 24, 2024 · 0 comments
Open
1 task

Image widths #12826

wildfiremedia opened this issue Dec 24, 2024 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@wildfiremedia
Copy link

wildfiremedia commented Dec 24, 2024

Astro Info

Astro                    v4.16.18
Node                     v22.12.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind

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

No response

Describe the Bug

If original image is 800px width, I have to set 800-1px?
/_image?href=...origWidth%3D800%26origHeight%3D535%26origFormat%3Dwebp&w=799&f=webp 799w

If I set exactly 800, same as the original image width, it will choose the previous width which is 512.

Bwoser network tab shown even if I set 1024px, should have been 1024px:
/_image?href=...origWidth%3D800%26origHeight%3D535%26origFormat%3Dwebp&w=512&h=342&f=webp 800w

The same when I wanted to set 1024w to upsized the original image from 800px -> 1024px, it will remain at 512.

What's the expected result?

I think the width should be exactly as what it should be. 800 mean 800 and not less.

<Image 
	widths={[382, 512, 764, 1024]} 
	width={512}
	height={342} 
	src={whattoexpect} 
	sizes={`
		(min-width: 1024px) 1024px,
		(min-width: 764px) 764px,
		(min-width: 512px) 512px,
		100vw
	`}
	alt="What to expect" />

Link to Minimal Reproducible Example

NA

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant