WordPress.org

Make WordPress Core

Ticket #23161: media.php.patch

File media.php.patch, 654 bytes (added by sergej.mueller, 5 years ago)

media.php

  • media.php

     
    348348                $crop_w = round($new_w / $size_ratio);
    349349                $crop_h = round($new_h / $size_ratio);
    350350
    351                 $s_x = floor( ($orig_w - $crop_w) / 2 );
    352                 $s_y = floor( ($orig_h - $crop_h) / 2 );
     351                $s_x = apply_filters( 'image_resize_dimensions_crop_start_x', floor( ($orig_w - $crop_w) / 2 ) );
     352                $s_y = apply_filters( 'image_resize_dimensions_crop_start_y', floor( ($orig_h - $crop_h) / 2 ) );
    353353        } else {
    354354                // don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
    355355                $crop_w = $orig_w;