Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11913 closed defect (bug) (fixed)

post thumbnail isn't using resized images

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: markjaquith's profile MarkJaquith
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.1
Component: Post Thumbnails Keywords:
Focuses: Cc:

Description

it seems like the new post thumbnail feature neither crops images, nor uses thumbnail images when available.

get_the_post_thumbnail() and set_post_thumbnail_size() seem to use the size of post-thumbnail, but image_downsize() only seems to understand a size of thumbnail.

this results in huge images in posts, even when the size is small.

Change History (5)

#1 @Denis-de-Bernardy
15 years ago

adding this code in a theme fixes the issue, in case anyone needs a temporary fix:

add_filter('image_downsize', 'my_thumbnail_downsize', 10, 3);
$thumbnail = get_the_post_thumbnail();
remove_filter('image_downsize', 'my_thumbnail_downsize', 10, 3);

...

function my_thumbnail_downsize($in, $id, $size) {
	if ( $in || $size != 'post-thumbnail' )
		return $in;
	return image_downsize($id, 'thumbnail');
}

#2 @nacin
15 years ago

  • Owner set to MarkJaquith
  • Status changed from new to assigned

#3 @nacin
15 years ago

  • Milestone changed from 2.9.3 to 3.0

#4 @ryan
15 years ago

  • Milestone changed from 3.0 to 3.1

#5 @markjaquith
15 years ago

  • Milestone changed from 3.1 to 3.0
  • Resolution set to fixed
  • Status changed from assigned to closed

I believe this was was fixed by [15002] Re-open if not, and provide a "did, expected, observed."

Note: See TracTickets for help on using tickets.