Changeset 30639
- Timestamp:
- 11/30/2014 06:26:26 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r30635 r30639 504 504 505 505 // if the resulting image would be the same size or larger we don't want to resize it 506 if ( $new_w >= $orig_w && $new_h >= $orig_h )506 if ( $new_w >= $orig_w && $new_h >= $orig_h && $dest_w != $orig_w && $dest_h != $orig_h ) { 507 507 return false; 508 } 508 509 509 510 // the return array matches the parameters to imagecopyresampled() -
trunk/tests/phpunit/tests/image/dimensions.php
r27472 r30639 129 129 } 130 130 131 function test_640x480() { 132 // crop 640x480 to fit 640x480 (no change) 133 $out = image_resize_dimensions(640, 480, 640, 480, true); 134 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h 135 $this->assertEquals( array(0, 0, 0, 0, 640, 480, 640, 480), $out ); 136 137 // resize 640x480 to fit 640x480 (no change) 138 $out = image_resize_dimensions(640, 480, 640, 480, false); 139 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h 140 $this->assertEquals( array(0, 0, 0, 0, 640, 480, 640, 480), $out ); 141 } 142 131 143 /** 132 144 * @ticket 19393
Note: See TracChangeset
for help on using the changeset viewer.