[wp-trac] [WordPress Trac] #48304: Big Image: Revisit 'threshold' suffix on file names

WordPress Trac noreply at wordpress.org
Mon Oct 21 20:31:53 UTC 2019


#48304: Big Image: Revisit 'threshold' suffix on file names
--------------------------+---------------------
 Reporter:  kraftbj       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.3
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by desrosj):

 Replying to [comment:11 chrisvanpatten]:
 > For whatever it's worth, I want to note that to me the simpler format
 here is a major advantage of this approach as it allows us to construct
 the URL to the "threshold" version from ''any'' size, without knowing
 exact dimensions. We were previously filtering core in gross/scary ways to
 get this behavior, and it's been amazing to be able to revert this code
 and use a simpler approach in core.
 >
 > Frankly, I'd like to see this change rolled out across the board; using
 the image size name as the suffix instead of exact dimensions. I'd be very
 disappointed to see this go away.

 Not saying you're use case  is unreasonable @chrisvanpatten, but wanted to
 play devil's advocate. Couldn't custom code just use Core's
 `big_image_size_threshold` filter to construct the image name? Something
 like:

 {{{
 $size = apply_filters( 'big_image_size_threshold', 2560 );

 $size_name = 'scaled-' . (int) $size;
 }}}

 Also, if the size is not found in the scaled image's name and a site adds
 a filter to `big_image_size_threshold` to change the scaled value, it
 could become difficult to know which images have been scaled to the
 correct dimensions and which have not.


 > Alternately, it would be nice to see this be filterable;

 A filter did come to mind here when looking through the changes.

 As far as [attachment:"48304.2.diff"] goes, I would be +1 to this to make
 it easier to identified images that were scaled or threshold-bound by WP.

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


More information about the wp-trac mailing list