- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Has anyone come across a way of scaling up / “upsizing” WordPress Post Thumbnails? My understanding is that, by default, WordPress will only generate the registered image sizes for an image upload if the original image is larger than the registered image size.
That is, if you upload a 600×400 image, and you have a registered image size that is 800×600 named “full-size”, the full-size image will not be generated – and therefore when you retrieve the image at full-size, expecting an 800×600, you get a 600×400 instead.
I’ve been thinking about this, and while I think upscaling is a bad idea from a graphical point of view (quality deterioration), I think from a user’s perspective this would be helpful (many users don’t want to deal with image resizing – they just want it to “work”).
I know timthumb can handle upscaling, but I want to use WP’s built in functionality for a variety of reasons. I also know I could scale the images via img tag sizes or CSS , but that (a) changes aspect ratios and (b) doesn’t help situations like images in Nivo Slider.
Anyway, if anyone has come across a clever way to enable WP thumbnail upscaling I’d love to know!
Thanks!
Chris
You could possibly use Jquery to do it so it doesnt distort the image http://plugins.jquery.com/plugin-tags/image-resize
also for a wordpress reference http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/post-thumbnail-template.php theres a filter on line 70 that may do what you want in a “hack”
EDIT : and line 62
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
OrganicBeeMedia said
You could possibly use Jquery to do it so it doesnt distort the image http://plugins.jquery.com/plugin-tags/image-resizealso for a wordpress reference http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/post-thumbnail-template.php theres a filter on line 70 that may do what you want in a “hack”
EDIT : and line 62
Thanks for the info. I may have to end up going with a jQuery solution as a last resort.
The filter on line 70 might help, but I’m hoping to find a way to generate the larger image in the first place (on media upload) rather than adjusting things when it’s ready to output.
Gonna start digging through the media upload code now 
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Well, for anyone who’s interested, I tracked down the code that constrains the image resizing (disallows upscaling).
//From function image_resize_dimensions() line 345-346 of wp-includes/media.php $new_w = min($dest_w, $orig_w); $new_h = min($dest_h, $orig_h);
If we were to make this change the limitation would be removed:
$new_w = $dest_w; //min($dest_w, $orig_w); $new_h = $dest_h; //min($dest_h, $orig_h);
Unfortunately, there is no appropriate action or filter hook to make this adjustment from a theme or plugin. I guess until WP offers this as an option there is no great solution here. I might try using a similar filter to the one mentioned by OrganicBee to generate the appropriate size if necessary.
What about image width/height attributes? Probably won’t be XHTML valid, but it solves your peoblem.
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
rvision_ said
What about image width/height attributes? Probably won’t be XHTML valid, but it solves your peoblem.
I appreciate the suggestion
Unfortunately, like I said in the OP, using img attributes to size the image (a) changes aspect ratios and (b) doesn’t help situations like images in Nivo Slider (which is what I am trying to use the images for). Thanks though!
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
UPDATE :
I figured out a solution to this issue. It’s a bit involved, but if anyone is interested let me know and I’ll try to do a writeup when I get a chance 
sevenspark said
UPDATE : I figured out a solution to this issue. It’s a bit involved, but if anyone is interested let me know and I’ll try to do a writeup when I get a chance![]()
Hello Sevenspark,
i have the same problem.. i am trying to use featured images as images for the nivo slider, and i am trying to figure out a ways to upsize small images to 960 px width…
the only way i can think of is using timthumb for this….
you said, you found a solution.. can you share it please with me?
thanks, avena
Yes, sharing your solution with others would be helpful.
sevenspark said
UPDATE : I figured out a solution to this issue. It’s a bit involved, but if anyone is interested let me know and I’ll try to do a writeup when I get a chance![]()
So what’s the solution
