I've been hunting around in the code to find where WordPress sets the default height and width that thumbnails are generated when using the upload functionality built into the page manager. Any ideas?
I've been hunting around in the code to find where WordPress sets the default height and width that thumbnails are generated when using the upload functionality built into the page manager. Any ideas?
I believe it is in the 'inline-uploading.php' file found under the 'wp-admin' directory. It should be lines 89 and 91.
OK so I've set the size up a bit.... but there is a problem. It seems to generate the thumbnail at the right size when I download it and look at it, but it is statically setting the height and width still to 128x96 in the HTML code... so even though the thumbnail is larger, it is being compressed down again. Any idea where this height and width value is set for the html?
if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) {
if ( $imagedata['width'] > 256 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 256);
elseif ( $imagedata['height'] > 192 )
$thumb = wp_create_thumbnail($file, 192);if ( @file_exists($thumb) ) {
$newdata = $imagedata;
$newdata['thumb'] = basename($thumb);
update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);
} else {
$error = $thumb;
}
You've lost me here. I'm not sure what you are using to insert the image into your post. If you are using the uploader to send the image by clicking on 'Send to editor', it sends the image to your editor without any html for specifying the width and height. Are you using something else?
It's ok I got it figured out. Thanks much!
Great to hear! Could you mark this post as resolved and possibly explain the final fix you made for everyones benefit. Thanks!
Man I can't believe it took me this long to respond to this. Basically there are a few more lines within inline-uploading.php (lines 237,239, 483, 495, 499) also there are a few lines at the bottom in admin-functions.php that need editing (1881 - 1890). Set all those values to whatever size you want your image thumbnails to be.
The Flexible Upload plugin allows you to resize thumbnails and original images for upload in WP 2.0+ http://blog.japonophile.com/flexible-upload/
It works quite well :-)
This topic has been closed to new replies.