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

[gatsby-source-contentful] Image transforms still have default width #14156

Closed
LuudJanssen opened this issue May 19, 2019 · 3 comments · Fixed by #14159
Closed

[gatsby-source-contentful] Image transforms still have default width #14156

LuudJanssen opened this issue May 19, 2019 · 3 comments · Fixed by #14159
Labels
stale? Issue that may be closed soon due to the original author not responding any more.

Comments

@LuudJanssen
Copy link
Contributor

Description

This pull request removed the default image width for image transforms to enable you to only set a height and have the image infer the correct width automatically, just like it does with the height when setting a width.

This default still exists and can be removed in gatsby-source-contentful because this pull request for gatsby-plugin-sharp infers the defaults automatically if neither width nor height are given.

Steps to reproduce

Source an image from contentful and only set the height for the image transform with a query like:

query getImageFixedHeight {
  allContentfulImages {
    nodes {
      image {
        fixed(height: 160) {
          width
          height
        }
      }
    }
  }
}

Expected result

height should be 160 and width should be scaled according to the aspect ratio of the image.

Actual result

width is always 400.

Environment

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.15 - /c/Python27/python
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.4.3 => 2.4.3
gatsby-cli: ^2.5.8 => 2.5.13
gatsby-image: ^2.0.41 => 2.0.41
gatsby-plugin-material-ui: ^2.0.0-alpha.4 => 2.0.0-beta.0
gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
gatsby-plugin-sharp: ^2.0.37 => 2.0.37
gatsby-plugin-styled-components: ^3.0.7 => 3.0.7
gatsby-source-contentful: ^2.0.40 => 2.0.56
gatsby-transformer-sharp: ^2.1.19 => 2.1.19

@LuudJanssen
Copy link
Contributor Author

I'm working on a pull request.

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jun 9, 2019
@gatsbot
Copy link

gatsbot bot commented Jun 9, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@sidharthachatterjee
Copy link
Contributor

Published in gatsby-source-contentful@2.0.69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants