[wp-trac] [WordPress Trac] #54648: Filter to let define the quality on subsize images

WordPress Trac noreply at wordpress.org
Mon Dec 20 23:36:04 UTC 2021

#54648: Filter to let define the quality on subsize images
 Reporter:  Mte90        |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  performance

Comment (by adamsilverstein):

 Hit @Mte90 - thanks for the bug report / feature request.

 Are you saying the `wp_editor_set_quality` filter
 is not applied during image sub-size generation?

 This filter is in `src/wp-includes/class-wp-image-editor.php` and I would
 have expected it to be applied because `set_quality` is called by each
 image editor during `load`.

 We still need to validate this filter works correctly when changing
 formats on upload (eg converting jpeg->webp).

 Currently that filter passes the image mime type, I wonder if there is
 more context data we could pass here (like image size) to address your
 idea of different compression levels?

Ticket URL: <https://core.trac.wordpress.org/ticket/54648#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list