• Resolved JoelDenne

    (@joeldenne)


    I’m trying to change the amount images get compressed when using this plugin, but the filter does not seem to be working – is there something in the plugin that needs changing?

    Sorry for the vague question – here is what I’ve tried, then deleting the cached images so it regenerates.
    Thanks

    // 1) Force Imagick first (fallback to GD if Imagick isn’t available)
    add_filter( ‘wp_image_editors’, function( $editors ) {
    return [ ‘WP_Image_Editor_Imagick’, ‘WP_Image_Editor_GD’ ];
    }, 10, 1 );

    // 2) Set quality for all formats, including PNG
    add_filter( ‘wp_editor_set_quality’, function( $quality, $mime_type, $dims = null ) {
    if ( $mime_type !== ‘image/png’ || empty( $dims[‘width’] ) ) {
    return $quality;
    }
    return 95;
    }, 10, 3 );

Viewing 1 replies (of 1 total)
  • Plugin Author kubiq

    (@kubiq)

    Hello,

    yes, this plugin uses default wp_get_image_editor function without any hard-coded arguments, so you should be able to use default WP filter and action hooks to control how WP generates images, but this will affect whole WP and not only this plugin of course.

Viewing 1 replies (of 1 total)

The topic ‘Compression setting’ is closed to new replies.