From 1e270f44a415748213a456a64a3175283128fea7 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 11 Sep 2012 01:38:26 +0000 Subject: [PATCH] Remove 'hwstring_small' from attachment metadata and deprecate get_udims(). props SergeyBiryukov. fixes #21518. git-svn-id: https://develop.svn.wordpress.org/trunk@21808 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/deprecated.php | 16 ++++++++++++++++ wp-admin/includes/image-edit.php | 5 ----- wp-admin/includes/image.php | 16 ---------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php index ff72ffd0be..275c7ab5ee 100644 --- a/wp-admin/includes/deprecated.php +++ b/wp-admin/includes/deprecated.php @@ -54,6 +54,22 @@ function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); } +/** + * Calculated the new dimensions for a downsampled image. + * + * @since 2.0.0 + * @deprecated 3.5.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 ) { + _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' ); + return wp_constrain_dimensions( $width, $height, 128, 96 ); +} + /** * {@internal Missing Short Description}} * diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index d2d6dc2cf3..8185c20e7c 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -414,8 +414,6 @@ function wp_restore_image($post_id) { $meta['file'] = _wp_relative_upload_path( $restored_file ); $meta['width'] = $data['width']; $meta['height'] = $data['height']; - list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); - $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; } foreach ( $default_sizes as $default_size ) { @@ -559,9 +557,6 @@ function wp_save_image($post_id) { $meta['width'] = imagesx($img); $meta['height'] = imagesy($img); - list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); - $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; - if ( $success && ('nothumb' == $target || 'all' == $target) ) { $sizes = get_intermediate_image_sizes(); if ( 'nothumb' == $target ) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 8048387677..2de1a7ee3b 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -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. *