admin管理员组文章数量:1335157
How do you successfully disable all image compression and resizing?
I would like Wordpress to use the image exactly as it is uploaded. same pixel dimentions, same quality.
I have gone down the route of adding to functions.php multiple strings that change the thresholds and the quality like...
add_filter(
'jpeg_quality',
function() {
return 100;
}
);
No joy.
There are multiple threads on this topic across the net, lots of similar suggestions, none of them work/work with the recent Wordpress release.
Has anyone been able to achieve this?
Thanks
How do you successfully disable all image compression and resizing?
I would like Wordpress to use the image exactly as it is uploaded. same pixel dimentions, same quality.
I have gone down the route of adding to functions.php multiple strings that change the thresholds and the quality like...
add_filter(
'jpeg_quality',
function() {
return 100;
}
);
No joy.
There are multiple threads on this topic across the net, lots of similar suggestions, none of them work/work with the recent Wordpress release.
Has anyone been able to achieve this?
Thanks
Share Improve this question asked Jun 10, 2020 at 10:56 Joseph LionJoseph Lion 113 bronze badges1 Answer
Reset to default 0Turns out I was never too far off.
Adding this to your functions.php will stop all resizing and compression of images uploaded to the media folder
add_filter(
'big_image_size_threshold', '__return_false' );
add_filter(
'jpeg_quality', function($arg){return 100;} );
update_option( 'medium_size_w', 9000 );
update_option( 'medium_size_h', 9000 );
update_option( 'large_size_w', 9000 );
update_option( 'large_size_h', 9000 );
Hope this helps someone
Thanks
本文标签: imagesDisable all resizing and compression
版权声明:本文标题:images - Disable all resizing and compression 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742342741a2456928.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论