Support » How-To and Troubleshooting » thumbnail size

thumbnail size

  • Is it possible to change the size of the thumbnails that are displayed in the posts.

    I like the new image uploader/manager, and the fact that a page is created for images, and comments can be made for them etc. I would just like the displayed thumbnails to be a little bigger.

Viewing 15 replies - 1 through 15 (of 56 total)
  • I would be interested in this as well.

    … also looking for this

    Moderator James Huff


    If you click on the image after dragging it inside the post window, you will see “grab boxes” which allow you to click-and-drag them in order to alter the image’s size.

    The resizing like that does not resize the image.
    It simply makes it bigger – which is not resizing.

    Upload an image, make it several times the size of the thumbnail. Result is a blurred and pixellated image.


    Moderator James Huff


    When you upload the image, click on it while it’s in the Upload interface to access the pull-down menu and select “Using Original”. If you select that, then the original image will be added to the post, rather than the thumbnail. The image will still drag-and-drop with the thumbnail’s size, but it will be much clearer when enlarged.

    I don’t get any pulldown menu using Firefox 1.5 and I do have javascript enabled. Is there anyone else that is having problems seeing the custom pulldown?

    Moderator James Huff


    Oops, I made a mistake in my previous post. I see the pull-down menu when I left-click on the image in the “Browse” tab once it’s uploaded. Try that.

    I have seen the options that are discussed above, but that doesnt quite answer what I am looking for. The above solution just stretches or scrunches whatever size thumbnail is on the page, in this case 96 pixels high or 128 pixels wide.

    I have dug around and experimented on my own, and I think I have figure out how to change the size of my thumbnail, but it does require changing one document.
    wp-admin / inline-uploading.php
    (At the moment I am using ms notepad so I cannot give you exact line numbers) Starting around line 80/83 you will see
    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);

    This seems to be the first instance of what size the images, thumbnails will be. I quickly did a search on the rest of the document and found reference to thumb size of 96 about 5 more times after these two, they are other parameters, css etc that will need to be changed. I also noticed that the width of 128 referenced in close relation to 96. I changed out 96 pixels with 150 and gave it a couple of test uploads and so far so good.

    I am a second rate hack, if somebody who actually knows what they are doing can verify that this will not “break” something etc etc

    I have tried left-clicking once the image is in “Browse.” My javascript console reports:

    doPopup is not defined

    I can see the function in that php file, but it’s not working for some reason?

    In addition to the information ergate has provided, there also seems to be pertinent code in wp-admin/admin-functions.php

    The code that ergate referenced in wp-admin/inline-uploading.php appears to determine the size of the thumbnail file that WP generates, but from what I can tell, does not actually affect the dimension attributes WP uses when inserting the image. For example, changing the code in inline-uploading.php will result in a thumbnail file with larger dimensions on your server, say 256×192, but when browsing and inserting the thumbnail into the post, WP will still apply the code using something like <img src="pic.jpg" width="128" height="96 />. This is where admin-functions.php comes into play.

    Lines 1771-1778 look something like this:

    function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96) {
    if ( $height <= $hmax && $width <= $wmax )
    return array($width, $height);
    elseif ( $width / $height > $wmax / $hmax )
    return array($wmax, (int) ($height / $width * $wmax));
    return array((int) ($width / $height * $hmax), $hmax);

    and lines 1863-1870 look something like this:

    function get_udims($width, $height) {
    if ( $height <= 96 && $width <= 128 )
    return array($width, $height);
    elseif ( $width / $height > 4 / 3 )
    return array(128, (int) ($height / $width * 128));
    return array((int) ($width / $height * 96), 96);

    Now I’ve tinkered around with it for a while, replacing the 128 and 96 values with larger integers. I have had limited success in which inserted images now appear with their original dimensions; however, when opting to insert thumbnails, the “thumbnails” are also stretched to the larger dimensions of the original, which causes them to be massively pixelated.

    I am by no means up to snuff on PHP and coding in general, so I have a feeling that if someone more knowledgable were to take a look at the source in these files, there is a way to alter the dimension integers appropriately so that original images and thumbnails are displayed with their correct dimensions respectively.

    Hopefully we can get this issue resolved soon.

    I have also contributed to an already-established ticket on Trac that documents this same problem: http://trac.wordpress.org/ticket/2199

    Excellent work on this so far, it would be nice to take control of this feature back from WP, as at the moment it is very limiting.

    Will be watching, good luck to those hacking through it.

    Over on Trac, ryan has posted a fix for this issue. The original ticket #2199 along with thumb-splint.diff are located at http://trac.wordpress.org/ticket/2199

    The revised inline-uploading.php is listed on Trac as part of changeset 3407: http://trac.wordpress.org/changeset/3407

    I have not yet had a chance to verify that this resolves the issue. I will be posting soon with details of success.

    The fix mentioned above seems to do the trick. Thanks to everyone who contributed in getting this resolved quickly.

    I fear I must be missing something. I uploaded the changed inline-uploading.php file and now I get no dimensions at all.

    The patch didn’t fix the problem for me either.

    Try adding this to line 400 of the original inline-uploading.php

    if ( document.getElementById('I'+n).innerHTML == usingoriginal )
    h = h.replace(new RegExp(' (width|height)=".*?"', 'g'), ''); // Drop size constraints

Viewing 15 replies - 1 through 15 (of 56 total)
  • The topic ‘thumbnail size’ is closed to new replies.