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

Prevent <Image> from generating srcset which doesn't support image size #2456

Closed
andershagbard opened this issue Aug 20, 2024 · 2 comments · Fixed by #2469
Closed

Prevent <Image> from generating srcset which doesn't support image size #2456

andershagbard opened this issue Aug 20, 2024 · 2 comments · Fixed by #2469
Labels

Comments

@andershagbard
Copy link
Contributor

andershagbard commented Aug 20, 2024

Which package or tool is having this issue?

hydrogen-react

What version of that package or tool are you using?

2024.7.1

Steps to Reproduce

  1. Upload a image to Shopify. E.g. 1500x1000
  2. Use <Image /> component, and set aspectRatio to 1/2
  3. Large srcset values will now load "correctly" with width and height attributes in correct aspect, but Shopify server can't transform images with width or height higher than original image size, and then return original image.

Expected Behavior

I would expect the <Image /> image component to omit any srcset value when it knows that it wont be generated for the specific aspect ratio

@andershagbard
Copy link
Contributor Author

@wizardlyhel I am willing to work on this, if the issue should be resolved?

@wizardlyhel
Copy link
Contributor

@andershagbard We happy if you can submit a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants