• Resolved johnthedocs

    (@johnthedocs)


    Hello,

    I found this post where it’s described how you can control Jetpack settings.

    Jetpack Hooks: Control Jetpack CDN

    I want to set the image quality to 100%.

    Can somebody help with setting this up? I don’t know how to enable this feature.

    <blockquote>How to change the way Jetpack CDN processes images
    By default, Jetpack automatically compresses images uploaded to the CDN. But some sites — say, a photography blog — may want to display images at the original quality, regardless of file size. This is where the jetpack_photon_pre_args filter comes in.
    
    function sa_custom_params( $args ) {
    	$args['quality'] = 100;
    
    	return $args;
    }
    add_filter( 'jetpack_photon_pre_args', 'sa_custom_params' );
    In the above example, the quality parameter is set to 100, which means images will be uploaded at full quality. If you want to make even more customizations, there are a variety of supported query arguments to fine-tune how Jetpack processes your images.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi @johnthedocs,

    You’re very welcome to use this code to set your image quality to 100%:

    function sa_custom_params( $args ) {
    	$args['quality'] = 100;
    
    	return $args;
    }
    add_filter( 'jetpack_photon_pre_args', 'sa_custom_params' );

    To apply that code to your site, I recommend using a plugin called Code Snippets:

    https://wordpress.org/plugins/code-snippets/

    This plugin allows you to edit the PHP files without touching it directly – it’s great for such customisations 🙂

    Hope that helps! Let me know how you get on and if you need further help.

    Thread Starter johnthedocs

    (@johnthedocs)

    After adding this snippet, will all the images be updated? There are some already cached images with less quality.

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hey @johnthedocs,

    They should. Perhaps give some times for the changes to fully propagate, clear your browser cache and check them again. If they don’t update to the better quality, do let us know (and share the image URLs with us) and we’ll take a closer look at it for you.

    Thread Starter johnthedocs

    (@johnthedocs)

    I have a lot of images, and they are not automatically updated.

    Is there a way to trigger a full purge of the already uploaded images, so they are updated with the new quality?

    Plugin Contributor Jen H. (a11n)

    (@jenhooks)

    Hey @johnthedocs,

    We could force a purge of our CDN, but we’d need a list of each image URL you’d like to have removed. These URLs will start with http://i0.wp.com, or similar.

    Thread Starter johnthedocs

    (@johnthedocs)

    But I have a few thousand images. Isn’t there a “purge-all” setting?

    Plugin Support MadHatter (a11n)

    (@madhattersez)

    There is not a tool or setting to purge all items at once from our side, no.

    They will all eventually catch up as our CDN looks to re-populate the media it has stored from your site, but we wouldn’t be able to give you an exact ETA on when they will all be at the new 100% setting.

    Thread Starter johnthedocs

    (@johnthedocs)

    That’s just stupid… I will look for a replacement for this.

    Either way, thanks for the help

    Plugin Contributor Jen H. (a11n)

    (@jenhooks)

    Hi @johnthedocs,

    I’m going to mark this thread as resolved now, but feel free to reach back out if you still need us. You can simply mark the Status as “not resolved” in the right sidebar.

    Cheers!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to set max image quality for Jetpack?’ is closed to new replies.