Support » Requests and Feedback » Thumbnail Cropping from top left instead of middle center

  • nealreal

    (@nealreal)


    I would like the thumbnail cropping feature to crop from top to left instead of center center. I love the new post-thumbnail feature and the cropping feature, but I wonder if it is, at all possible, to change the way WP is cropping my thumbnails.

Viewing 6 replies - 1 through 6 (of 6 total)
  • nealreal

    (@nealreal)

    I found the solution! I’m using WP 2.9.1
    Go to your includes > media.php file.
    Line: 309 and 310

    $s_x = floor( ($orig_w - $crop_w) / 2 );
    $s_y = floor( ($orig_h - $crop_h) / 2 );

    Replace the above with:

    $s_x = 0;
    $s_y = 0;

    This will make WP crop from top to left.
    I would keep the old code commented above it just for reference.

    nealreal

    (@nealreal)

    Once you’ve made changes, the easiest way to redo all your old thumbnails with the new settings is to install this plug-in:
    Regenerate Thumbnails
    this will regenerate all your plug-ins.
    You may also want to hit “refresh” a couple of times to see the newly cropped thumbnails.

    nealreal

    (@nealreal)

    This works for WP 2.9.2 as well.

    That’s a workaround but ideally WordPress should allow the user control over the crop position of every image.

    Is this something that will come in WordPress 3? I hope so..This is really frustrating especially for a portfolio site where you want to showcase the best part of the image in the thumbnail.

    I second rosacreative, because most of the time the important visual information of an image is on the top center part.

    is there a way to do this other than editing the core?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Thumbnail Cropping from top left instead of middle center’ is closed to new replies.