mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
Image FUNction, fixes #1797
git-svn-id: http://svn.automattic.com/wordpress/trunk@3042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
41775561d5
commit
3feb023992
@ -1724,4 +1724,13 @@ function wp_handle_upload(&$file, $overrides = false) {
|
|||||||
return array('file' => $new_file, 'url' => $url);
|
return array('file' => $new_file, 'url' => $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96) {
|
||||||
|
if ( $height <= $hmax && $width <= $wmax )
|
||||||
|
return array($width, $height);
|
||||||
|
elseif ( $width / $height > $wmax / $hmax )
|
||||||
|
return array($wmax, (int) ($height / $width * $wmax));
|
||||||
|
else
|
||||||
|
return array((int) ($width / $height * $hmax), $hmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user