Opened 12 years ago
Last modified 5 years ago
#23779 new defect (bug)
Can't insert large image if it's smaller than media setting but larger than theme setting
Reported by: | aaroncampbell | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Media | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
If you upload an image that is larger than $content_width but not larger than the "large" setting in settings->media, the option to insert a "large" image into the post isn't available even though the image is large enough.
It looks like it must use $content_width as the actual width of the large image that's inserted, and the large_size_w setting to decide whether to show that option or not.
Attachments (2)
Change History (18)
#3
@
12 years ago
- Keywords reporter-feedback removed
When it creates the dropdown and when it inserts the image into the post it uses $content_width, a theme-defined global variable, if it exists.
To see what I mean, enable Twenty Twelve which uses $content_width = 625, and leave your media setting for large to the default 1024. Now upload an image that is wider than 1024 and you will get the option to insert the large image into the post but the width will be 625. Now upload an image that is 800px wide (or something between 625 and 1024) and you don't have the large option. Instead you have to insert the full-size and then resize it.
I've had several users that were really frustrated by this. The workaround is pretty easy (just set the media settings to match the theme), but it's not very obvious. They expect to be able to use the large option if the image they upload is larger than what they always see as the "large" option (which is $content_width).
#4
@
11 years ago
- Milestone changed from Awaiting Review to 3.6
This is really interesting. Took me a bit to fully understand it.
Is this reproducible in 3.4?
#6
@
11 years ago
- Keywords has-patch added
- Version changed from 3.5 to 3.0
Reproduced in 3.0. 23779.diff uses the original image metadata if a size's metadata is not available, and performs a check before adding the size, to make sure we don't see duplicate sizes when full and large are equal.
#7
@
11 years ago
- Keywords 3.7-early added
- Milestone changed from 3.6 to Future Release
Since this goes back a ways, moving to 3.7.
#9
@
11 years ago
Refreshed in 23779.2.diff, still works as expected.
#10
@
11 years ago
- Cc wikicms@… added
For example Twenty Twelve theme uses full-width template with $content_width = 960
also. And this width option do not show to us. It would be very good to select width (without manual resizing after uploads) when using custom templates.
#11
@
11 years ago
It appears that 23779.2.diff would cause duplication. It's not just for the "large" size image, but for any additional image sizes that are larger than the content width but smaller than the uploaded image. Then what would happen is you'd have every image size listed as the same constrained width. Desired?
#13
@
11 years ago
If I understand, we should check if the original image width is between $content_width
and a default 'thumbnail' - 'medium' and 'large' sizes and other custom sizes ?
So every defined sizes that have a higher value should default to the $content_width
size as Nacin said.
So do we have to display the default 'thumbnail-medium-size' + those the user wants to display in the dropdown even if they have the same sizes ? or maybe set an "all-in-one" size name for all cases ?
If the uploaded image is smaller than Large size in media settings, the large size is not generated. Since
wp_prepare_attachment_for_js()
only fills in the sizes that actually exist for the image, the Large option is in unavailable in the dropdown.Or am I missing something?