[wp-trac] [WordPress Trac] #38965: Thumbnails with dimensions lower than the thumbnail setting aren't recognized
WordPress Trac
noreply at wordpress.org
Mon Nov 28 22:58:13 UTC 2016
#38965: Thumbnails with dimensions lower than the thumbnail setting aren't
recognized
----------------------------------------+------------------------
Reporter: Clorith | Owner: joemcgill
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 4.7
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+------------------------
Changes (by joemcgill):
* keywords: => has-patch needs-unit-tests
* status: reviewing => accepted
* milestone: Awaiting Review => 4.7
Comment:
Turns out the issue is related to a change to
`wp_prepare_attachment_for_js()` introduced in [38949], which results in a
`sizes` attribute not being generated if there are no intermediate sizes
in the metadata. Specifically, it's the change to this line:
Old:
`if ( $meta && 'image' === $type ) {`
New:
`if ( $meta && ! empty( $meta['sizes'] ) ) {`
[attachment:38965.diff] addresses the issue by always adding a sizes
attribute when the attachment type is an image.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38965#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list