#22598 closed defect (bug) (fixed)
Not using image_downsize() in wp_prepare_attachment_for_js() can break esoteric usage
Reported by: | nacin | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
If you disable all intermediate image sizes (so no images are created on upload), and then create them on the fly using the image_downsize filter (say, with a URL that can dynamically create images on the fly), our clever use of image metadata in wp_prepare_attachment_for_js() doesn't work.
We need to use image_downsize(). Preliminary patch attached.
If it is too slow for tons of prepares (and I imagine it may be), we may be able to fire the filter only, as long as the size exists in the metadata array for cases where the filter is not used.
Attachments (2)
Change History (8)
Note: See
TracTickets for help on using
tickets.
Second patch avoids image_downsize(). Best I can tell, we don't need any of the logic in image_downsize(), which consults the same metadata we do here and does a bunch of other things. We just need to know if a plugin wants to handle the downsizing, and if not, we can consult metadata.