datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 51 forks source link

Imgix aspect ratio #87

Closed robbinjohansson closed 4 years ago

robbinjohansson commented 4 years ago

👋

Trying to use Aspect ratio | ar and I'm getting the following error:

error Expected type Float, found "16:9"

This is what my code looks like:

image {
  fluid(imgixParams: { auto: "compress", fit: "crop", w: "400", ar: "16:9" }) {
    ...GatsbyDatoCmsFluid
  }
}

If I change the ar parameter to float, e.g ar: 16.9 the error disappear but the parameter invalid, should be W:H as according to the docs.

I've tried using both fluid and fixed images.

Is this a bug in this package or am I missing something?

Thanks,

matjack1 commented 4 years ago

I agree with you @robbinworks :)

I think we should change this!

stefanoverna commented 4 years ago

Fixed in 685ba3c!