I’m trying to get a responsive image that has an aspect ratio of 16:9 for desktop, and 3:4 for mobile portrait, however I always get the 16:9 size.
My graph-ql query is like this:
responsiveImage(imgixParams: {auto: format, fit: crop, crop: focalpoint, h: 810}) {
srcSet
webpSrcSet
sizes
src
width
height
aspectRatio
alt
title
base64
}
The issue here was that the image was not being cropped with that parameter, he had to specify a smaller width to actually crop the image, if you’d like you can send us the specific URL with the imgix parameters you are using so we can take a look at it
Thank you, @m.finamor for the quick response.
I manage to make it work, I just needed to add a w and h parameter
responsiveImage(imgixParams: {fit: crop, auto: format, crop: focalpoint, w: 530, h: 450}) {
sizes
src
width
height
alt
title
base64
}
These are my parameters. Which led me to another question. The w and h parameter can have any value as long they respect the proportion I need ? Or should I choose the parameters according to the size the image will be displayed.