Something is Resizing Images I Don't Want Resized

Hello,

I don’t know if it’s a theme issue, a plugin issue, or a CDN issue.
Something is resizing an image to 761 px width, even if I set it to 100% or manually set it to 1200 px (which is the actual image width.


Can you see what’s happening?

All the other images on the page are resizing to exactly how i want them, but this one refuses to go any bigger than 761px.

Jesse @ USAT

Nevermind, It’s the Jetpack image accelerator, i found out how to prevent it from resizing specific images with thefunctions.php addition below:

function my_photon_exception( $val, $src, $tag ) {
        if ( $src == 'YOUR_IMAGE_URL' ) {
                return true;
        }
        return $val;
}
add_filter( 'jetpack_photon_skip_image', 'my_photon_exception', 10, 3 );

Hi Jesse,

We are glad that you are able to solve your issue. If you have any other concerns, feel free to reach us.

Thank you.

And for people not good with PHP, this is how you add additional image URLs within the script.

function my_photon_exception( $val, $src, $tag ) {
        if ( $src == 'https://usatcorp.com/wp-content/uploads/2020/09/SCADA-Horizontal-Infographic-Utilities.png' ) {
                return true;
         } else if ( $src == 'https://usatcorp.com/wp-content/uploads/2020/09/USAT-Vehicle-Networking-Graphic-V2.png' ) {
                return true;
        }
        return $val;
}
add_filter( 'jetpack_photon_skip_image', 'my_photon_exception', 10, 3 );

Hello Jesse,

Thank you for sharing this information. It is very useful for other users.

Have a great day!
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.