Turn off auto webp formatting with gatsby-source-datocms with gatsby-image

When using gatsby-source-datocms with gatsby-image it appears that it will serve webp images automatically if there is browser support. I have run into an instance where my source image (png) is smaller than the equivalent webp image. Is there a way to not serve webp for this use case?

I’ve found a few places where this subject is discussed:
Google dev

PNG: 37KB
WEBP: 74KB

I’m not exactly sure what you are doing, but if you simply pull information from Gatsby we don’t do any webp auto formatting.

In your case, I’ve tried this

{
  datoCmsFrontPage {
    pandaLogo {
      url
    }
  }
}

and I get the PNG back.

If you cannot figure it out I might need access to your repo. Feel free to contact me either here via private messages or at https://www.datocms.com/support

Sorry, I looked a bit more and you are right it’s our plugin: https://github.com/datocms/gatsby-source-datocms/blob/4dc24c5eff40103df8d3dc1cc0374e5574b60ada/CHANGELOG.md#v210

I’ll turn this into a feature request.

Summary: would be good to have the option of using the automatic conversion of images or not when using gatsby-image and our gatsby-source-plugin

1 Like

I’m going to bump this. I’m trying to query for an image as a png with width and height parameters, and the auto=format option is always in the url, even if I provide my own value.

Fixed in this release. Thanks team!

Release v2.5.13 · datocms/gatsby-source-datocms (github.com)

1 Like