Cms: Glide Presets & Format Not Working

Created on 17 Jan 2021  路  4Comments  路  Source: statamic/cms

Bug Description

Glide presets are not respecting the 'format' parameter the same way using the glide tag directly does, it always makes jpg images not webp images ...

How to Reproduce

{{ glide:image format='webp' }} works, it produces a webp image

However this does not:
{{ glide:image preset='homepage_webp' }}
where my preset is ...

'homepage_webp' => [
    'w' => 940,
    'h' => 368,
    'fit' => 'crop',
    'format' => 'webp',
],

Environment

Statamic 3.0.36 Solo
Laravel 8.20.1
PHP 7.4.13
statamic/ssg 0.2.0

Install method (choose one):

  • Fresh install from statamic/statamic
assets bug

All 4 comments

Try using fm聽instead of format as the key, that works in PHP code, so it might with the presets

Yeah, in the presets you have to use the actual glide parameters, not the aliases we provide to the tag.

Is this document somewhere? I could not find any documentation on this.

It's probably not the easiest documentation to find, but here's the format docs and here's the presets docs.

Was this page helpful?
0 / 5 - 0 ratings