New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting Format to Auto with Imgix + Craft 4 Not Returning Auto Format Image #357
Comments
Here's the relevant code: // Handle the Imgix auto setting for compression/format
$autoParams = [];
if (empty($params['q'])) {
$autoParams[] = 'compress';
}
if (empty($params['fm'])) {
$autoParams[] = 'format';
}
if (!empty($autoParams)) {
$params['auto'] = implode(',', $autoParams);
} I'm a little confused as to why this isn't working as expected, it definitely used to work. |
You were able to reproduce this then? Not sure either, I'm really out of my element here and not sure I can help with a solution, but was just aware enough to notice it seemed to not be working as expected. |
@khalwat . I can also replicate this issue. |
@MamlukiSn I'm assuming you're on Craft 4 as well? |
Yes I'm on craft 4 as well. |
So I did some testing locally, and it seems to be working as expected. Here's what I'm getting for the output:
These are the parameters being sent into Imgix, here's an example URL:
It's not passing in the When I dump the incoming transform, I see this:
so the What am I missing here? |
Okay so I managed to track this down. It was due to this bug fix: #343 which fixes a regression/bug in Craft that caused it to go into an infinite loop and hang if the Addressed in: 7d8d147 You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v4 as 4.0.3”, Then do a |
Rad—thanks for tracking this down and addressing this! |
Thanks. Works great now. |
Describe the bug
When using Imgix for transforms with ImageOptimize in Craft 4, and setting
format
toauto
for each of the transforms, the images served from Imgix on the front-end are still in the original file format they were uploaded as (in browsers that support modern formats like avif or webp), and I can see in the request thatauto=format
isn't present in the query string params. It seems likeauto=format
might not be getting sent to Imgix.To reproduce
auto=format
Expected behaviour
As described in the OptimizedImages documentation, when
format
is set toauto
for image transforms, Imgix should send back images withauto=format
which should serve up modern file formats for browsers that support them (Imgix docs).Screenshots
auto: format
missing, andfm: pjpg
present in the image request's query string paramsVersions
I can share a testing URL privately via Discord or something if it's helpful.
The text was updated successfully, but these errors were encountered: