• Help – I’m pulling my hair out trying to figure out how to get the image quality setting changed for the Add Media function.

    One recommendation I tried was to add the following line of code to my theme’s function.php:
    add_filter( ‘jpeg_quality’, create_function( ”, ‘return 70;’ ) );

    Well that didn’t work.
    Next I changed the quality setting from 90 to 70 in
    wp-admin\includes\image-edit.php

    That didn’t work either.
    I next tracked down a quality setting in the file
    wp-includes\deprecated.php
    and changed 90 to 70 there as well. Still no change in the generated images.

    I have searched through every php and js file in admin, content, and includes and can find no other references to jpeg_quality.

    Does anyone have any ideas?

    PS – I verified that none of these changes worked by uploading multiple differently named versions of the same source image file. In every case the output files were identical in size.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter artsnovadotcom

    (@artsnovadotcom)

    Digging further, I found another reference setting quality as follows:

    File: wp-includes\class-wp-image-editor.php
    Code: protected $default_quality = 90;

    I changed this one to 70 as well. Made absolutely no difference.

    So what’s the point of an image quality variable if it’s value is ignored?

    JenR

    (@jennifer-roberts)

    Have you looked for a plugin? This looks like it may do what you want:

    https://www.ads-software.com/plugins/wp-resized-image-quality/

    BTW, definitely would not recommend modifying any core files :).

    Thread Starter artsnovadotcom

    (@artsnovadotcom)

    Hi JenR,

    I did look. What is really annoying is that people would have to install a plugin to change something as simple as a default value for a variable.

    I have no problem with modifying the core files, especially since the only change being made is to a variable constant – changing it from 90 to 70. Apparently WordPress ignores these values as changing them has made absolutely no difference!!!

    I even searched through the mySQL database thinking that perhaps the variable was being set there but found nothing.

    Thread Starter artsnovadotcom

    (@artsnovadotcom)

    Highly annoying that jpeg image compression is a total fail.

    The compression I am referring to is the compression of the images that are automatically created as a part of the add new media functionality. If you look in media settings you will see that you can set sizes of images to be automatically created when you upload a new image. This image generation appears to be handled by plupload. Apparently changing the jpeg_quality value has absolutely no impact on plupload.

    What I’d really like to know is who thought that it would be a good idea to create thumbnails at 100% quality?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing Image Quality Setting’ is closed to new replies.