[wp-trac] [WordPress Trac] #54648: Improve filter to enable setting quality for each subsize image

WordPress Trac noreply at wordpress.org
Sat Jul 2 09:55:05 UTC 2022


#54648: Improve filter to enable setting quality for each subsize image
----------------------------------------+------------------------------
 Reporter:  Mte90                       |       Owner:  adamsilverstein
     Type:  enhancement                 |      Status:  accepted
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Media                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  performance
----------------------------------------+------------------------------

Comment (by codekraft):

 hi @birgire,
 i've also found a way to extend the WordPress image generation
 capabilities, I use "wp_generate_attachment_metadata" to hook after the
 standard generation process. some examples here:
 [https://gist.github.com/erikyo/ebd78f0d5d1735175e5ab9ad1d4d0590 webp] or
 [https://gist.github.com/erikyo/428a8f4b04c057945116e70fd2891c0c square
 images].

 However I think it is a really impractical way and I would like more
 granular control over image generation, currently (width, height, crop) is
 really tight for today's needs

 it will also be convenient in the future because some new formats have the
 quality parameter that works completely different from jpg, for example
 the default quality of avif is 50 (out of 100) when for jpg it was 87

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


More information about the wp-trac mailing list