Prevent WordPress to compress your jpg images

March 30, 2012 at 7:24 pm

By default, WordPress compress uploaded jpg images. This is a good thing because it makes the files smaller, but in some case, image quality can be more important. If you need to prevent WordPress to compress your images, simply apply this simple tip.

Open your functions.php file and paste the code below in it:

add_filter('jpeg_quality', function($arg){return 100;});

Save the file, and you’re done. That’s simple as that!

Thanks to WP Snippets for the tip!

Tags: