
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.






WPRecipes.com is hosted by VidaHost. Use our exclusive coupon CATSWHOCODE to get a 10% discount on hosting! 








5 Responses
Hello
I let you check this page :
http://codex.wordpress.org/Function_Reference/add_filter
The callback can not be a function … Testing before posting is more pro.
Julio: Reading the full documentation you link to is even more pro; it says, “You can also pass the callback paramater as an anonymous function,” which is what the code given above does.
Can it work in PHP 5.2.4 (WP min requirements at this time ?)
Because PHP manual says that anonymous functions work only from PHP 5.3.
Also, this code will only work with PHP 5.3 or newer. WordPress works with older versions, so a disclaimer that this code may cause errors on certain installations may be in order.
Here’s a more compatible snippet:
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );100can, of course, be changed to any valid percentage. Changing it to 1 results in some interesting, lo-fi uploads.Just drop images into ImageOptim instead?
Trackbacks: