Make WordPress Core


Ignore:
Timestamp:
11/30/2014 06:26:26 AM (10 years ago)
Author:
wonderboymusic
Message:

Fix edge-case in media cropping where selection and destination are the same size.

Adds unit tests.

Props mboynes.
Fixes #19793.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r30635 r30639  
    504504
    505505    // 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 ) {
    507507        return false;
     508    }
    508509
    509510    // the return array matches the parameters to imagecopyresampled()
Note: See TracChangeset for help on using the changeset viewer.