images - Disable all resizing and compression

How do you successfully disable all image compression and resizing?I would like Wordpress to use the image exactly as it

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Turns 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742342741a4425953.html

相关推荐

  • images - Disable all resizing and compression

    How do you successfully disable all image compression and resizing?I would like Wordpress to use the image exactly as it

    4天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信