Focal point crop with aspect ratio

Unsure if this is expected behaviour or not, but my responsive image queries are not having their focal point set automatically when an aspect ratio is also used.

From the announcement on the blog:

“When requesting a cropped version of an image without explicitly specifying a crop mode, DatoCMS will automatically center the crop on the focal point.”

Does setting the aspect ratio count as specifying a crop mode? If so, it would be great to be able to get the focal-point functionality when using aspect ratios.

hey @hayden.osborne, can you please send an example of your usage and your expected behaviour? Thank you!

Running a query with the aspect ratio set on a responsive image field:

image {
  responsiveImage(imgixParams: { ar: "1:1", fit: crop }) {
    ...responsiveImageFragment
  }
}

Results in the images being returned without focal point values being set (some fields have been omitted for clarity):

aspectRatio: 1
height: 600
sizes: "(max-width: 600px) 100vw, 600px"
src: "https://www.datocms-assets.com/[url].jpg?ar=1%3A1&fit=crop"

Running the same query using dimensions instead of aspect ratio:

image {
  responsiveImage(imgixParams: { w: 400, h: 400, fit: crop }) {
    ...responsiveImageFragment
  }
}

Results in the images returned having their focal point set (again, some fields have been omitted for clarity):

aspectRatio: 1
height: 400
width: 400
sizes: "(max-width: 400px) 100vw, 400px"
src: "https://www.datocms-assets.com/[url].jpg?crop=focalpoint&fit=crop&fp-x=0.6&fp-y=0.31&h=400&w=400"

If possible, I would like the first query to return the same result as the second (aside from the different dimensions).

ok, looks like a bug to me, we’ll investigate and get back to you!

@hayden.osborne setting just the ar parameter has no effect on the output, see https://www.datocms-assets.com/205/1597757278-austin-distel-wd1lrb9oeeo-unsplash.jpg?ar=1:1 for example.

You need to set ar toghether with either w or h!