[wp-trac] [WordPress Trac] #44316: Pass original file path to image_resize_dimensions() so it can be accessed in the filter

WordPress Trac noreply at wordpress.org
Wed Jun 6 16:10:12 UTC 2018


#44316: Pass original file path to image_resize_dimensions() so it can be accessed
in the filter
-----------------------------+--------------------------------------
 Reporter:  danielbachhuber  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Future Release
Component:  Media            |    Version:
 Severity:  normal           |   Keywords:  needs-patch dev-feedback
  Focuses:                   |
-----------------------------+--------------------------------------
 The Google Cloud Vision API has a neat
 [https://cloud.google.com/vision/docs/detecting-crop-hints crop hints]
 feature that a plugin could incorporate to produce smarter thumbnail
 crops.

 `image_resize_dimensions()` seems like a sensible place to incorporate
 this behavior. However, the `image_resize_dimensions` filter doesn't
 include the original file. For filter callbacks to know which crop hints
 to suggest, they'll need to have access to the original file.

 We should pass the original file path into `image_resize_dimensions()` so
 the file can be inspected in the `image_resize_dimensions` filter.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44316>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list