[wp-trac] [WordPress Trac] #35390: image_constrain_size_for_editor() should not affect images generated on the front end when `large` size is used.
WordPress Trac
noreply at wordpress.org
Wed May 31 21:17:13 UTC 2017
#35390: image_constrain_size_for_editor() should not affect images generated on the
front end when `large` size is used.
------------------------------------------+-----------------------------
Reporter: rabmalin | Owner: joemcgill
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: Future Release
Component: Media | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-unit-tests needs-patch | Focuses:
------------------------------------------+-----------------------------
Comment (by pressupinc):
Hi all, want to sharpen the question mentioned in comment 26, as I think
knowing the answer will make the route forward a lot clearer:
To everyone's knowledge, is the ''only proper use'' of
`image_constrain_size_for_editor()` to reduce the size of images in the
TinyMCE Visual editor, so that the editing experience isn't slowed down by
the display of excessively large images? Is that what "constraining an
image's size for editor" is ''for''?
Or is there something else it's also for? In other words, is there another
place - in the admin or on the frontend - where it's ''correct'' for
editor-scaled dimensions to be used? I know these dimensions ''are'' being
used in other places (like `wp_prepare_attachment_for_js()`, and in other
uses of `wp_get_attachment_image_src()`, which caused my original bug,
#38906); but if I know that the only ''proper'' use of it is for scaling
images within the Visual editor, then I think we can narrow down the
functions that should be calling `image_constrain_size_for_editor()` to
just one - `get_image_tag()`, the function that outputs properly scaled
`img` tags into the Visual editor - without needing to chase down every
single caller of `wp_get_attachment_image_src()` and see what it does.
So if we can get confirmation that that's exclusive intent behind editor-
constraining image sizes, we should be quite a bit closer to a fix.
Thanks!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35390#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list