mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Image FUNction, fixes #1797
git-svn-id: https://develop.svn.wordpress.org/trunk@3042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1724,4 +1724,13 @@ function wp_handle_upload(&$file, $overrides = false) {
|
||||
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);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user