WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 10 months ago

#38780 new enhancement

Thumbnail images should be cropped from the centre top

Reported by: johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Given a tall image of portrait orientation, the default behaviour of WordPress is to crop the image to the centre middle when creating the thumbnail image.

This means that for images such as portrait photographs or infographics, the thumbnail is far from optimal. The centre top of such images would be a better crop.

I think it makes sense to switch the default thumbnail image size cropping to centre top instead of centre middle.

Attachments (1)

38780.patch (426 bytes) - added by dhanendran 11 months ago.

Download all attachments as: .zip

Change History (8)

#1 @lukecavanagh
11 months ago

@johnbillion

So based on image orientation, then set the default hard crop?

Smart cropping still seems like a feature which would be of use being in core.

#2 @johnbillion
11 months ago

The orientation doesn't actually matter to the cropping position, because centre top is the same as centre middle when cropping a landscape orientation (or square) image.

@dhanendran
11 months ago

#3 @dhanendran
11 months ago

@johnbillion added the path for this issue with this ticket.

Modified the default positions in the array as 'top', as we are having the values set for the 'top' below. This will not affect the landscape images as we are cropping it from top. Tested this with multiple images and works good for me.

Please check and let me know if it is fine.

Thanks,
Dhanendran

#4 @joemcgill
11 months ago

  • Keywords 2nd-opinion removed

I like the intent of this, but worry about the implications. This would need a lot of testing to better understand use cases where this change would result in a worse experience than the current defaults. I should also note that it's already possible for someone to modify their own thumbnail cropping option by adding a filter to option_thumbnail_crop or updating the thumbnail_crop option directly.

#5 @dhanendran
11 months ago

Yes @joemcgill agreed, User has option to modify the defaults. But the question is, is current defaults working correctly? When I upload a portrait image the defaults crops from center which may affect the image context.

I agree that, it needs lot of testing to understand and verify the fix.

#6 @markhowellsmead
11 months ago

It's difficult to say how many vertical-format images are portraits and therefore whether this change would be an improvement. A non-scientific analysis of the first few hundred Google search results for portrait images show that the face in many portraits is in the centre or along the upper median third line of the image. So if they're cropped to a square or horizontal format, the crop would chop off the bottom half of the face. My opinion is that if there's an option for the default action to be changed programmatically on a per-case basis, that should be sufficient.

#7 @dhanendran
10 months ago

  • Keywords has-patch added; needs-patch good-first-bug removed
Note: See TracTickets for help on using tickets.