Skip to content
Public Ticket #24775

disable auotmatic image compression of wordpress

Conversation thread

maverick728 singh replied

Customer Reply

you can close the case now. thank you

maverick728 singh replied

Customer Reply

one thing solved my issue for big images.

I added following code in function.php file. ( to remove the max resolution cap)

add_filter( 'big_image_size_threshold', '__return_false' );


this stopped the wordpress to resize the image. now the image is clear.


maverick728 singh replied

Customer Reply

I dont understand regenerating all the image thumbnails. My apologies. 

What is this tool going to do about the new images which I will upload? will it resize all my images? i dont want to resize my previous images.

FYI (just in case) : Im uploading new image after making the changes to function.php and after activating the plugin. but still the image is blured.


please guide. Highly appreciate your help.

maverick728 singh replied

Customer Reply

The original file (looks clear)

5860490584.png

After uploading the same file it becomes hazzy and also the resolution changes when i select full image to display

4532624970.png

9044137028.png

Just giving you some more info if that can be of some help.

maverick728 singh replied

Customer Reply

Im trying to upload web file. im still seeing that the image is getting compressed. 

Is it because the code mentions jpeg file and im uploading webp file?

maverick728 singh replied

Customer Reply

thank you for the code. let me try

PenciDesign Supporter replied

Staff Reply

Hi,

Please add the following code to your site:

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

Regards,
PenciDesign.


maverick728 singh replied

Customer Reply

EDIT: this code given in that website is non sense. Any one reading this comment should not follow the code mentioned in that website.

Following link provides some solution. But i dont know if that is advisable. hence asking for your advise

https://www.megademic.com/how-to-stop-wordpress-compressing-jpg-images/

Something like:

// Disable WordPress image compression

add_filter( 'wp_editor_set_quality', function( $arg ) {

return 100;

});

I dont know

maverick728 singh started the conversation

Conversation Start

Hello,


How can i disable automatic image compression on my website. I searched on google but could not fing the code in function.php file. 

wordpress compresses all the image files irrespective of the extension . jpg, webp etc.

also can you recommend any other way to upload images in blogpost.


please help. thanks for all the help in advance.


Want to join this conversation or access attachments? Sign in first.