Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Anton Vanyukov

    (@vanyukov)

    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

    Thread Starter milesgeek

    (@milesgeek)

    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.

    Plugin Author Anton Vanyukov

    (@vanyukov)

    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?

    Thread Starter milesgeek

    (@milesgeek)

    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.

    Plugin Author Anton Vanyukov

    (@vanyukov)

    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

    Thread Starter milesgeek

    (@milesgeek)

    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!

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Awesome. Will mark this thread as resolved

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Issue with generated URL has w=(blank)’ is closed to new replies.