You can add the below to either your theme’s functions.php
file or a custom plugin.
To disable the big image size threshold, you can do this:
add_filter( 'big_image_size_threshold', '__return_false' );
To set the JPEG quality to the highest (uncompressed), use this:
add_filter( 'jpeg_quality', function() {
return 100;
} );
Note that these will not revert existing images. The changes will only take effect for newly-uploaded images.
Hello, Justin,
I’m encountering the same problem and I copied your code and added it to one snippet in Code Snippets as follows, but it did not work.
The image at–
https://casahatcher.com/wordpress/wp-content/uploads/woman_of_emotive_colors-test.jpg
–downloads with a file size of 892 KB, but I uploaded an image with a file size of 2.30 MB.
Your assistance is greatly appreciated.
Michael
————
// To disable the big image size threshold
add_filter( ‘big_image_size_threshold’, ‘__return_false’ );
// To set the JPEG quality to the highest,uncompressed
add_filter( ‘jpeg_quality’, function() {
return 100;
} );
Hello, Justin,
I found the problem. I overlooked the JPEG quality setting on the plugin I am using, “Easy Watermark”.
I apologize for any inconvenience this post caused.
Sincerely,
Michael
Hello Justin,
just tried the code and it works perfectly. Thanks for sharing.
Just case of stop WordPress from automatically compressing images, you can follow these steps:
- Access Your WordPress Dashboard: Log in to your WordPress admin panel.
- Go to Settings: Click on “Settings” in the left-hand menu.
- Select Media: Within the Settings menu, select “Media.”
- Adjust Image Sizes: You will find various options for image sizes. These include Thumbnail size, Medium size, and Large size. By default, WordPress may apply compression to these sizes. To prevent this, you can set these sizes to “0” (zero). This tells WordPress not to generate those sizes, which can help prevent additional compression.
- Save Changes: Don’t forget to click the “Save Changes” button at the bottom of the page to apply your settings.
By following these steps, you can have more control over the compression of your images in WordPress, allowing you to maintain the quality and avoid automatic compression.
To prevent WordPress from automatically compressing images, you can make adjustments through both regulation and law. First, within the WordPress platform itself, you can explore the settings related to image compression. Navigate to the “Settings” menu, then select “Media.” Here, you may find options to adjust the image compression settings or disable automatic compression.
On the regulatory front, it’s essential to comply with existing laws governing digital content and data. Ensure that your website aligns with applicable regulations such as the General Data Protection Regulation (GDPR) or other data protection laws in your jurisdiction. These regulations often include provisions related to user consent and the handling of personal data, which may indirectly impact how images are processed.
In addition, consider checking if there are specific laws or guidelines in your region that pertain to website accessibility and user experience. Adhering to these regulations can influence how you handle images on your WordPress site.
By combining platform-specific adjustments with a mindful approach to relevant regulations, you can work towards preventing automatic image compression on your WordPress website while staying within the bounds of the law.
Actually, i was also stuck in the same problem that when i upload and publish the picture it seem virtually not visible clearly .i was using an additional plugin(Third party) to write by blog post. You can use your default editor to overcome this problem which is given by the wordpress.
I experienced the same problem when I download the images from the WordPress . Help me out please.
I’m currently experiencing the same problem with DNG format file uploading. I tried the solutions above, but the time it’s been uploaded to wordpress, it’s been compressed badly. Please help me out. π
-
This reply was modified 1 year ago by
hanyc666.
Take your social media skills to the next level with our step-by-step guide on creating content, engaging your audience, and monetizing your channel. Make your social media dreams a reality.
Yes, You can actually digitize all this to make this service easier to the users.