mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
Fix edge-case in media cropping where selection and destination are the same size.
Adds unit tests. Props mboynes. Fixes #19793. git-svn-id: https://develop.svn.wordpress.org/trunk@30639 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -128,6 +128,18 @@ class Tests_Image_Dimensions extends WP_UnitTestCase {
|
||||
$this->assertEquals( array(0, 0, 0, 20, 400, 500, 480, 600), $out );
|
||||
}
|
||||
|
||||
function test_640x480() {
|
||||
// crop 640x480 to fit 640x480 (no change)
|
||||
$out = image_resize_dimensions(640, 480, 640, 480, true);
|
||||
// dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
|
||||
$this->assertEquals( array(0, 0, 0, 0, 640, 480, 640, 480), $out );
|
||||
|
||||
// resize 640x480 to fit 640x480 (no change)
|
||||
$out = image_resize_dimensions(640, 480, 640, 480, false);
|
||||
// dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
|
||||
$this->assertEquals( array(0, 0, 0, 0, 640, 480, 640, 480), $out );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 19393
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user