C
C
carbanak012020-08-12 14:27:45
WordPress
carbanak01, 2020-08-12 14:27:45

How to disable image compression in WordPress?

Hello!
The site is built on WordPress + WooCommerce.
When I add a picture of a product, the picture is compressed and shown on the site with worse quality.
I tried to remove the compression with the hook and the TinyPNG plugin, both options do not help.
Hook:

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2020-08-12
@azerphoenix

I tried to remove the compression with the hook and the TinyPNG plugin, both options do not help.

If we are talking about compression, then remove the photo optimization plugins. EWWW Image Optimizer, TinyPNG, etc.
Compression can also be enabled on the server side. For example, jpegoptim, jpegtran, etc. You can also look and check.
As noted by Dima Dolgoter , there is a difference between image compression and a thumbnail.
What do I need to do in order for the image to be displayed on the site in its original quality?

Well, for starters, look in the console at the original size of the thumbnail and the size of the output image.
For example, the initial thumbnail size is 150 x 150 pixels. On the site, it can be increased using CSS, for example, up to 300x300 pixels. Of course, in this scenario, there will be pixelization. Accordingly, if you need to display thumbnails of 300x300, then create thumbnails of 300x300

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question