Skip to content

Instantly share code, notes, and snippets.

@joshbetz
Last active May 22, 2019 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshbetz/9399b50dc4d47e774bd4 to your computer and use it in GitHub Desktop.
Save joshbetz/9399b50dc4d47e774bd4 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Photon Lossy Compression
* Plugin URI: https://josh.blog/2015/01/lossy-compression-with-photon
* Description: Lossy compression of images using the Jetpack Photon CDN.
* Version: 1.0.0
* Author: Josh Betz
* Author URI: https://josh.blog
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
// Photon: 80% jpeg quality
add_filter('jetpack_photon_pre_args', function( $args ) {
$args['quality'] = 80;
return $args;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment