[wp-trac] [WordPress Trac] #38594: pdf preview sizes not filterable

WordPress Trac noreply at wordpress.org
Wed Nov 2 18:09:30 UTC 2016


#38594: pdf preview sizes not filterable
-------------------------------------------+------------------------------
 Reporter:  nosilver4u                     |       Owner:  joemcgill
     Type:  enhancement                    |      Status:  reviewing
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Media                          |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback needs-patch  |     Focuses:
-------------------------------------------+------------------------------

Comment (by nosilver4u):

 I do want to emphasize that EWWW does make use of the ability to filter
 the resizes generated. EWWW Image Optimizer gives users the ability to
 disable the creation of certain resizes, and it would be nice to extend
 this to the realm of pdf previews as well.

 The other thing that several IO plugins have is the ability to disable
 optimization of specific resizes, and this is where we get into the 'take
 other action' part of the deal:
 EWWW IO extends the WP_Image_Editor class to make sure all images saved by
 WP_Image_Editor are optimized. To ensure that the specified resizes do not
 get optimized accidentally by the WP_Image_Editor extension, EWWW uses the
 intermediate_image_sizes_advanced filter to remove the wp_image_editors
 filter, and then restores the wp_image_editors filter during the
 wp_generate_attachment_metadata filter.

 I wanted to do it as late as possible in the processing, so that any
 images that other plugins might generate along the way still get optimized
 (both before AND after the creation of resizes). So they are basically
 just pass-through filters toggling EWWW's WP_Image_Editor class. The only
 example I can think of off-hand is retina images, but there are probably
 others too.

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


More information about the wp-trac mailing list