From 672bd9a43d3599c1ed583edabece7fe6260ef935 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 4 Jan 2013 08:52:18 +0000 Subject: [PATCH] Media: Pass thumbnail and medium sizes to image_constrain_size_for_editor() to force constraints based on the current DB options for those sizes. History: see #22598, #22738. props jond3r. see #23102. for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@23264 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/media.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 705b36c351..fa28a45af3 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1391,13 +1391,8 @@ function wp_prepare_attachment_for_js( $attachment ) { $size_meta = $meta['sizes'][ $size ]; // We have the actual image size, but might need to further constrain it if content_width is narrower. - // This is not necessary for thumbnails and medium size. - if ( 'thumbnail' == $size || 'medium' == $size ) { - $width = $size_meta['width']; - $height = $size_meta['height']; - } else { - list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' ); - } + // Thumbnail, medium, and full sizes are also checked against the site's height/width options. + list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' ); $sizes[ $size ] = array( 'height' => $height,