#13947 closed defect (bug) (duplicate)
Featured image doesn't crop
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Media | Version: | 3.0 |
| Severity: | major | Keywords: | reporter-feedback |
| Cc: | raven@…, toscho |
Description
When using featured image (post-thumbnail), if you crop an image and assing it as featured image, the assigned image is the original one, not the cropped one.
Possibly related: #13404
Change History (21)
- Cc toscho added
- Summary changed from Feautred image doesn't crop to Featured image doesn't crop
comment:5
follow-up:
↓ 6
slawrence10 — 3 years ago
I'm using:
add_theme_support( 'post-thumbnails', array( 'post' ) ); set_post_thumbnail_size( 246, 225, true );
in functions.php and works as expected
Replying to slawrence10:
add_theme_support() doesn’t accept a second parameter.
My last working configuration …
add_theme_support('post-thumbnails');
set_post_thumbnail_size(200, 150, TRUE);
… stopped working with WP 3.0.
So, yes, this looks like a regression.
- Resolution set to invalid
- Status changed from new to closed
Updating problems.
It works the same way in Media Library and Post -> Add new image -> Gallery
- If the image is assigned as featured image, you can only crop. It assumes all sizes.
- If the image is not assigned, you can crop it and assign the crop to All sizes, thumbnail or All except thumbnail.
I suppose it's the correct way to work with thumbnails to don't have assignment problems.
Also replying to toscho:
You can set the thumbnail size in Settings -> Media and it works.
And then, to get the thumbnail or a custom thumbnail:
the_post_thumbnail(); // without parameter -> Thumbnail
the_post_thumbnail('thumbnail'); // Thumbnail
the_post_thumbnail('medium'); // Medium resolution
the_post_thumbnail('large'); // Large resolution
the_post_thumbnail( array(100,100) ); // Other resolutions
- Milestone 3.0.1 deleted
toscho,
if you think it's a bug/regression, feel free to re-open the ticket with further information.
comment:9
JohnONolan — 3 years ago
- Milestone set to 3.1
- Priority changed from normal to high
- Severity changed from normal to major
Not sure what further information is required here? I haven't found any way to get a post thumbnail to crop since 3.0 - regardless of what $crop is set to, it always resizes as if $crop is set to false.
comment:10
JohnONolan — 3 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
comment:11
JohnONolan — 3 years ago
- Owner set to nacin
- Status changed from reopened to assigned
comment:12
nacin — 3 years ago
Is this a duplicate of #13404?
comment:13
JohnONolan — 3 years ago
Nope, not as far as I can tell
comment:14
markjaquith — 2 years ago
- Resolution set to invalid
- Status changed from assigned to closed
This bug needs a better description. What you did, what happened, what you expected.
comment:15
JohnONolan — 2 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
@markjaquith - Simplest explanation I can give is to echo the_thumbnail() in a theme file and define $crop as "true" in functions.php - the output will always be as if $crop is set to false.
To clarify:
$crop = true: fit the shortest length into specified dimensions, crop the rest. Exact thumbnail dimensions are filled.
$crop = false: fit the longest length into the specified dimensions. Original aspect ratio is preserved, no exact thumbnail dimensions.
comment:16
JohnONolan — 2 years ago
*I've reproduced this across multiple installs and hosting environments
comment:17
markjaquith — 2 years ago
Are you aware that cropping is only intended to work going forward? That is, you can't (yet) use an old image and expect WordPress to crop it on the fly. Just making sure that you're testing this by uploading a NEW image, and seeing if that is cropped.
comment:18
JohnONolan — 2 years ago
Affirmative, have taken this into account
comment:19
markjaquith — 2 years ago
- Resolution set to duplicate
- Status changed from reopened to closed
First, the issue you're reporting doesn't appear to be the issue described in this ticket. This ticket appears to be a duplicate of #13404. So I'm closing on that account
Second, I can't reproduce the issue you described related to the crop parameter:
http://screencast.com/t/rfQpzhmna
Open a new ticket for that issue, with reproduction steps.
comment:20
in reply to:
↑ 7
bi0xid — 2 years ago
Adding some light to this ticket.
It was first opened because the system did not crop already uploaded files with the system editor. It's working since 3.0 See image
Second problem encountered was comment 7, working correctly too, even if the image is marked as featured.
So everything working in the original ticket.
comment:21
ocean90 — 2 years ago
- Milestone 3.1 deleted

As a quick fix, use:
the_post_thumbnail( array ( 150, 150 ), // size array ( 'class' => 'attachment-post-thumbnail' ) );