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

[feature]: Image middleware should allow height and crop #1359

Closed
2 of 6 tasks
sirugh opened this issue Jun 17, 2019 · 0 comments · Fixed by #1361
Closed
2 of 6 tasks

[feature]: Image middleware should allow height and crop #1359

sirugh opened this issue Jun 17, 2019 · 0 comments · Fixed by #1361
Assignees
Labels
enhancement New feature or request

Comments

@sirugh
Copy link
Contributor

sirugh commented Jun 17, 2019

Is your feature request related to a problem? Please describe.
The product images from sample data are 25:31 ratio.
The placeholder image we use is 4:5.

This is a difference of only a few pixels but it leads to a poor UX where we sometimes have a placeholder image that is too large (ie. on the category page) or we have a UI that "shifts" down/up when we render a placeholder and then replace it with the product image (ie. on the pdp).

Describe the solution you'd like
I would like to allow our image resizer (sharp middleware) to crop/resize based on a height parameter. Currently we only pass the width and let it resize to the width based on the image's original ratio.

Describe alternatives you've considered
Ideally we would have sample data and a placeholder that have identical ratios but apparently it is difficult to regenerate/remake sample data and the smallest ratio that would match our sample data is 370:379 🤣

Additional context
Image from Gyazo

Please let us know what packages this feature is in regards to:

  • venia-concept
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant