Opened 7 years ago
Last modified 3 weeks ago
#43531 new defect (bug)
$content_width and Add Media (+ twentyseverteen?)
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9.4 |
Component: | Media | Keywords: | close |
Focuses: | Cc: |
Description
I apologize in advance if this isn't a bug. However, I couldn't seem to find any documentation on the expected behavior (e.g., there's nothing on the codex page for the image_size_names_choose filter). None the less, it certainly feels odd / awkward.
When adding an image (to a post / page), the size setting select (Add Media > Attachment Display Setting > Size) doesn't feel quite right. I understand the relationship between (global) $content_width and this setting. That is, the <img> tag's width= is forced / maxed to the $content_width (if the image is wider than the $content_width).
I see this happening for the size = large images, as well as any image sizes I've added via add_image_size() that are too wide. However, it (i.e., the forced max width=) doesn't happen to the size Medium when the Medium width is set wider than the content width.
Perhaps this is intentional?
Theme was twentyseventeen. Unfortunately, I've haven't had time to try to reproduce this on another theme. The size Medium was set to 800 x 800.
I'd like to suggest the Settings > Media page display the current $content_width, as well as explain a bit, as well as link to a deeper explanation. As it is, a user can select a theme, blindly set the image sizes (not realizing who they actually map to the theme), and then be hit with the experience (?) described above, AND have no idea why.
Truth be told, it took me too long to figure this out. Somehow I've managed to avoid $content_width. Too many custom themes maybe? :)
Or am I just missing something about the intent of what otherwise feels like a sloppy experience?
I hope this helps. TIA
Change History (6)
#3
@
6 years ago
@joyously said
"This is why there is another ticket to remove the image size options, since the sizes computed for the browser to choose from are based on the largest uploaded."
A link to this ticket / discussion would be a big help.
"I don't think adding explanation here will be helpful when the thing being explained is a moving target."
Okay. But where then? It's not in the codex and it is media + theme related.
tia
#4
@
6 years ago
The ticket for removing image sizes is #44441.
I don't think it needs explanation at all. I couldn't even figure out what you were talking about (a succinct statement of the problem). There are many things that WordPress does not explain, and how to leave the image sizing to the browser could be one of them.
#5
@
3 weeks ago
- Keywords close added; ux-feedback removed
Thank you everyone for your thoughts here. A few pieces, this appears to be expected behavior of the system. It also is a long time and referring to an older theme. On this basis I am going to recommend closing this ticket. A recommendation to close does mean people can raise up it shouldn't be though. If other information comes to light we can always review.
#6
@
3 weeks ago
@karmatosed -"...referring to an older theme."
LOL. Well of course it is, this ticket was opened 7 years ago!!!!
Perhaps if ol' Matt spent less time being Matt (i.e., megalomaniac) and more time thinking about the rest of us... that wouldn't happen??
Again, perhaps it is the expected behavior, that doesn't mean it's correct. It certainly feels like it's not.
In summary... Close the ticket. This was a complete waste of my time and yet another reason I've given up on opening tickets here or issue on Github. Thanks. Good luck.
The problem with this is the sizes on Settings > Media page applies only to images uploaded after you change the sizes. And the content width is different for every theme, which can be switched at any time, including programmatically for each page (like a Theme Switcher plugin). And the actual width is different for every visitor's device window.
This is why there is another ticket to remove the image size options, since the sizes computed for the browser to choose from are based on the largest uploaded.
I don't think adding explanation here will be helpful when the thing being explained is a moving target.