Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

imageSizes dont use the correct format (prod)

default discord avatar
akacronos2 years ago
2

For some reason, some imageSizes doesn't get the correct format in prod, but in my local, payload creates the correct versions/formats



upload: {
    staticURL: '/media',
    staticDir: 'media',
    imageSizes: [
      {
        name: 'hero',
        width: 1440,
        height: 810,
        position: 'center',
      },
      {
        name: 'thumbnail',
        width: 576,
        height: 432,
        position: 'center',
      },
      {
        name: 'square',
        width: 800,
        height: 800,
        position: 'center',
      },
    ],
    mimeTypes: ['image/*'],
    formatOptions: {
      format: 'webp',
      options: {
        losselesss: true,
      },
    },
  },
  • discord user avatar
    dribbens
    2 years ago

    What versions of Payload are we looking at with these screenshots?

  • default discord avatar
    akacronos2 years ago

    Im using payload 1.6.26



    Im going to update to 1.6.27, I see that 1.6.26 wasn’t an oficial release.



    well, I update, but now in local just the main file gets the webp format, the other sizes are created in png. :S



    Found this in other post, I have to add the format for each size.



    Yep, this works! 🙂

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.