Remove 'hwstring_small' from attachment metadata and deprecate get_udims(). props SergeyBiryukov. fixes #21518.

git-svn-id: http://core.svn.wordpress.org/trunk@21808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2012-09-11 01:38:26 +00:00
parent 1508b46bb4
commit 670105e1fb
3 changed files with 16 additions and 21 deletions

View File

@@ -117,8 +117,6 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$imagesize = getimagesize( $file );
$metadata['width'] = $imagesize[0];
$metadata['height'] = $imagesize[1];
list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
// Make the file path relative to the upload dir
$metadata['file'] = _wp_relative_upload_path($file);
@@ -160,20 +158,6 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
}
/**
* Calculated the new dimensions for a downsampled image.
*
* @since 2.0.0
* @see wp_constrain_dimensions()
*
* @param int $width Current width of the image
* @param int $height Current height of the image
* @return mixed Array(height,width) of shrunk dimensions.
*/
function get_udims( $width, $height) {
return wp_constrain_dimensions( $width, $height, 128, 96 );
}
/**
* Convert a fraction string to a decimal.
*