• 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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I believe it is in the ‘inline-uploading.php’ file found under the ‘wp-admin’ directory. It should be lines 89 and 91.

    Thread Starter simplestation

    (@simplestation)

    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 128×96 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?

    Thread Starter simplestation

    (@simplestation)

    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!

    Thread Starter simplestation

    (@simplestation)

    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+ https://blog.japonophile.com/flexible-upload/
    It works quite well ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How do I set the size of thumbnails that wordpress 2.03 makes?’ is closed to new replies.