Describe the bug
Before we start: we have a regular CloudFormation stack with Sharp on AWS. It's important that in our case AutoWebPParameter is always enabled(=ON).
So, while doing another image optimization, we noticed that changing the quality does not affect the image file size.
It turns out that this is because the quality does not change at all.
Although we noticed that this works if we call,srcsetWebp for example, but not in the case of srcset.
To add, in our case the extension of the original image is usually JPG or PNG.
Having debugged the converted URL (base64-encoded), we saw that there are "edits" object with "jpeg" edits as a key, where quality and other stuff are defined.
However, my guess is that because it AutoWebPParameter is enabled, we always have WebP in the output, even if we call srcset rather than srcsetWebp.
And it looks like the JPG is just ignored in that case, which makes sense.
{% do asset.setTransform({'quality': 10 }) %}
Example decoded output without WebP:
{
"bucket": "mybucket",
"key": "myimage.png",
"edits": {
"png": {
"quality": 10,
"progressive": false
},
"resize": {
"fit": "cover"
},
"sharpen": true
}
}
{% do asset.setTransform({'quality': 10, 'format': 'webp'}) %}
Example Decoded output with WebP:
{
"bucket": "mybucket",
"key": "myimage.png",
"edits": {
"webp": {
"quality": 10
},
"resize": {
"fit": "cover"
},
"sharpen": true
}
}
Perhaps a flag or something like that could be added so that instead of "jpeg", the base64-encoded JWT always has “WebP” for case when expected output is always in WebP?
To reproduce
- In your AWS CF stuck turn on
AutoWebPParameter parameter.
- Call the regular image transform with the changed quality, e.g. 10.
{% set asset = craft.assets.id(123).one() %}
{% do asset.setTransform({'quality': 10 ) %}
...
- Do the same, but add
format: webP
{% set asset = craft.assets.id(123).one() %}
{% do asset.setTransform({'quality': 10, 'format': 'webp' ) %}
...
- See that the first image transform quality is still 100%. The second image transform quality is 10%.
Expected behaviour
In both cases image transform should respect quality param.
Screenshots
Not sure that it would be possible to see difference on the Screenshot

Versions
- Plugin version: 5.0.7
- Craft version: 5.7.1
Describe the bug
Before we start: we have a regular CloudFormation stack with Sharp on AWS. It's important that in our case
AutoWebPParameteris always enabled(=ON).So, while doing another image optimization, we noticed that changing the quality does not affect the image file size.
It turns out that this is because the quality does not change at all.
Although we noticed that this works if we call,
srcsetWebpfor example, but not in the case ofsrcset.To add, in our case the extension of the original image is usually JPG or PNG.
Having debugged the converted URL (base64-encoded), we saw that there are "edits" object with "jpeg" edits as a key, where quality and other stuff are defined.
However, my guess is that because it
AutoWebPParameteris enabled, we always have WebP in the output, even if we callsrcsetrather thansrcsetWebp.And it looks like the JPG is just ignored in that case, which makes sense.
{% do asset.setTransform({'quality': 10 }) %}Example decoded output without WebP:
{% do asset.setTransform({'quality': 10, 'format': 'webp'}) %}Example Decoded output with WebP:
Perhaps a flag or something like that could be added so that instead of "jpeg", the base64-encoded JWT always has “WebP” for case when expected output is always in WebP?
To reproduce
AutoWebPParameterparameter.format: webPExpected behaviour
In both cases image transform should respect quality param.
Screenshots
Not sure that it would be possible to see difference on the Screenshot

Versions