Hi @milesgeek,
I think this might be caused by images not having a size defined. Probably some plugin is passing in the image src without those params.
Could you please try adjusting the plugin file app/class-core.php and on line 792 change
$image[0] = "$domain/$hash/$cloudflare_image_id/w=" . $image[1];
to
$image[0] = "$domain/$hash/$cloudflare_image_id/w=" . $image[1] ?? apply_filters( 'big_image_size_threshold', 2560 );
This should fallback to the scaled image size, if, for some reason, the sizes attribute is not defined for an image.
Best regards,
Anton
Hi,
Thank you for the reply. I tried the above changes without success. But I then also tried disabling the setting ‘Disable WordPress image sizes‘ and then images started appearing properly.
I turned if off / on a couple of times to verify it made the difference. I’m happy to test anything else you would like if it helps at all. I should note I reverted the change you suggested as well to make sure it was not a combination of the changes.
Hm. It’s definitely this part. Can you please try replacing with:
$width = $image[1];
if ( empty( $width ) ) {
$width = apply_filters( 'big_image_size_threshold', 2560 );
}
$image[0] = "$domain/$hash/$cloudflare_image_id/w=" . $width;
Do you, by any chance, have the option Disable WordPress image sizes enabled?
That did not do the trick.
Yes, as mentioned in my prior reply, everything works if I do not have the Disable WordPress image sizes enabled. It seems to be related to that for sure.
Hi @milesgeek ,
Sorry for the delay. While I was debugging this, I found another issue with scaled images, which I had to fix. I have published a beta release here: https://github.com/av3nger/cf-images/releases/tag/1.1.6-beta.1
This should fix your issue
Best regards,
Anton
No problem, I had a busy week myself so the timing is great. I was just able to install and test. I’m happy to report it did fix the issue and the w= is properly being populated with the image width even when I have “Disable WordPress image sizes enabled”.
Thank you so much!
Awesome. Will mark this thread as resolved