Opened 7 years ago
Closed 6 years ago
#44316 closed enhancement (worksforme)
Pass original file path to image_resize_dimensions() so it can be accessed in the filter
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
The Google Cloud Vision API has a neat 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.
Change History (6)
#2
@
6 years ago
@danielbachhuber were you ever able to resolve this? For the record, I'm not against adding additional info to image_resize_dimensions()
if it would be useful.
#3
@
6 years ago
@joemcgill Yep, here was my implementation: https://github.com/pantheon-systems/pantheon-image-enrichment/pull/18/files#diff-7f700be2854ee6240f8845362137ddd3R73
As it turns out,
intermediate_image_sizes_advanced
may be sufficient for my needs because I could include quadrant-based crop suggestions (e.g.top,left
). I'll update once I've explored further.