mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
Fix edge-case in media cropping where selection and destination are the same size.
Adds unit tests. Props mboynes. Fixes #19793. Built from https://develop.svn.wordpress.org/trunk@30639 git-svn-id: http://core.svn.wordpress.org/trunk@30629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
67e5d4041c
commit
5352f51516
@ -503,8 +503,9 @@ function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = fal
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the resulting image would be the same size or larger we don't want to resize it
|
// if the resulting image would be the same size or larger we don't want to resize it
|
||||||
if ( $new_w >= $orig_w && $new_h >= $orig_h )
|
if ( $new_w >= $orig_w && $new_h >= $orig_h && $dest_w != $orig_w && $dest_h != $orig_h ) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// the return array matches the parameters to imagecopyresampled()
|
// the return array matches the parameters to imagecopyresampled()
|
||||||
// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h
|
// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-beta2-30638';
|
$wp_version = '4.1-beta2-30639';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user