Closed Hless closed 3 years ago
Quick update for anyone else experiencing a similar issue, I found a workaround using the aspect ratio parameter:
gatsbyImageData(
width: 160
height: 152
layout: FIXED
imgixParams: {ar: "160:152", fit: "crop", crop: "focalpoint"}
)
Edit: Focalpoint parameters are not getting created by the dato plugin either it seems (my asset does have a focalpoint), so I'm still figuring that out
Hi @Hless, please try version 2.6.7, the following should work (also with focal points)
gatsbyImageData(
width: 160
height: 152
layout: FIXED
)
@stefanoverna Whoa that was fast 🎉 . While with version 2.6.7 the focalpoint parameters do work, it seems to ignore the outputPixelDensities
parameter specified by gatby-plugin-image (default is [0.5, 1, 2]
for CONSTRAINED and [1, 2]
for FIXED). Basically the 2.6.7 update is effectively breaking retina support across my whole website, because constrained images are also affected.
I verified that densities were still working on 2.6.6, should I open a new ticket?
You're right, 2.6.8 should do the trick!
@stefanoverna Yes, can verify that the pixel densities are working correctly in 2.6.8, and automatically adding 'ar' to the query is a nice addition.
It just does not seem to work in conjuction with focal points, is this a limitation of the library, or an oversight? Right now I'm not getting focal point information added to the query in any way. I have resorted to using a combination of 'face,edges' for now (which is fine for my use case). But it would be great to have focalpoints working gatsby image
Damn it, you're right again :D
73a12d61744cf6 solves the final issue with focal points, released as 2.6.9!
Thanks for reporting!
Awesome! It's working beautifully now 👍
I'm using
gatsby-source-datocms
in combination withgatsby-plugin-image
, but I can't get cropping to work as expected.I'm using the following query to get a source set of images with my prefered width/height:
The resulting srcSet that is generated looks like this (urls obfuscated):
If I understand correctly the gatsby image parameters get converted automatically to imgix params, however since I'm requesting a FIXED layout should it not also add
h
to the imgix query?Relevant package versions: