Skip to content

Conversation

@axe312ger
Copy link
Contributor

@gatsbybot
Copy link
Collaborator

gatsbybot commented Feb 23, 2018

Deploy preview for gatsbygram ready!

Built with commit 03aa963

https://deploy-preview-4207--gatsbygram.netlify.com

@axe312ger axe312ger changed the title Fix contentful image handling [pls review] Fix contentful image handling Feb 23, 2018
@axe312ger
Copy link
Contributor Author

@Khaledgarbaya maybe u can have a look :)

Copy link
Contributor

@Khaledgarbaya Khaledgarbaya left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

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

Nice work!

const resp = await resolveResponsiveSizes(image, {
maxWidth: 450,
maxHeight: 399,
maxHeight: 400,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change this back to 399? It was set this way to test that rounding works I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh, felt so weird to me to have such an non-practical height and a resulting aspect ratio of 1.1278195488721805

but yes, I can do that :)

width: 450,
height: 399,
quality: 50,
background: `rgb:000000`,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah cool 👍

@axe312ger axe312ger force-pushed the fix/contentful-image-handling branch from 87a10d9 to 03aa963 Compare February 25, 2018 13:10
@axe312ger
Copy link
Contributor Author

@KyleAMathews this is ready for re-review :)

exports[`contentful extend node type resolveResponsiveSizes generates responsive sizes data for images using all options 1`] = `
Object {
"aspectRatio": 0.75,
"aspectRatio": 1.1278195488721805,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like something broke this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the outcome of the bugfix for this result w=450&h=399 b0c658c

It returned the original aspect ratio while the resulting one should be returned

Copy link
Contributor

Choose a reason for hiding this comment

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

ahhh :-) cool!

@KyleAMathews KyleAMathews merged commit 125743a into gatsbyjs:master Feb 26, 2018
@KyleAMathews
Copy link
Contributor

Thanks!

@axe312ger axe312ger deleted the fix/contentful-image-handling branch February 26, 2018 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants