If you have a maximum height and width you’d like, and want WP to ALWAYS make a thumbnail no matter how huge your image is, this code for inline-uploading.php seems to work:
'FIND THIS LINE:
add_post_meta($id, '_wp_attachment_metadata', $imagedata);
/* NOW ADD THIS AFTER IT */
$maxthumbheight = 450;
$maxthumbwidth = 450;
if(($imagedata['width']>$maxthumbwidth) OR ($imagedata['height']>$maxthumbheight)) {
if($imagedata['width']>$imagedata['height']) {
$thumb = wp_create_thumbnail($file, $maxthumbwidth);
} else {
$thumb = wp_create_thumbnail($file, $maxthumbheight);
};
/* DONE ADDING */
/* COMMENT THIS OUT
if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) {
if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 128);
elseif ( $imagedata['height'] > 96 )
$thumb = wp_create_thumbnail($file, 96);
COMMENT THIS OUT */
if ( @file_exists($thumb) ) {
$newdata = $imagedata;
$newdata['thumb'] = basename($thumb);
update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);
} else {
$error = $thumb;
}
}
Basically you can set a maximum thumbnail size for both the height and the width, and it should figure out which of those is the longer edge in your image and constrain it to that. The only time it won’t make a thumbnail is if the image is already smaller than the max thumbnail size itself.
It still isn’t ideal (it is still hardcoded, but at least it is easier to change than it was before), but for me it seems to have done what I want in the short term… if I had any idea how the WP interface worked I’d try to make up something with some options, but I haven’t develed into that level of things yet.