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

feat(gatsby-plugin-image): Make dimensions optional and default to constrained #28662

Merged
merged 8 commits into from
Dec 16, 2020

Conversation

ascorbic
Copy link
Contributor

Based on discussions about new defaults, this makes the following changes:

  • Default layout is "constrained"
  • Dimensions are no longer required!
    • If layout is fixed and no dimensions are provided, width is taken from the size of the source image
    • If layout is constrained, maxWidth is taken from the size of the source image
    • If layout is fluid, maxWidth is half the width of the source image. This is so the largest generated image is the size of the source image.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 16, 2020
@laurieontech laurieontech added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 16, 2020
laurieontech
laurieontech previously approved these changes Dec 16, 2020
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Are we opting for maxWidth for fluid acting as true maxWidth for now?

Noticing we have some unit tests that are no longer valid. I'll take a look at those.

@laurieontech laurieontech merged commit f24a23d into master Dec 16, 2020
@laurieontech laurieontech deleted the fix/image-plugin-defaults branch December 16, 2020 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants