Support » Fixing WordPress » Need help …not creating thumbnails

  • Resolved jackfussell

    (@jackfussell)


    I finally got images to upload but now I can’t get them to form thumbnails so I can place in posts. Can someone help me with this?
    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    How big are these images? Not in size, but in megapixels. What is the resolution of the images?

    Thread Starter jackfussell

    (@jackfussell)

    They are around 3000X2000. 6.1 megapixels
    Is this the problem?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Yes. WordPress is coded to not generate thumbnails for any image over 3 megapixels. This can be changed, but you may run into PHP memory issues.

    Add this to your theme’s functions.php file (or to a plugin or whatever):

    function raise_image_size_limit() {
    return -1;
    }
    add_filter('wp_thumbnail_creation_size_limit','raise_image_size_limit');

    That will disable the size limitation. No guarantee that it will actually work though. To generate a thumbnail, it must decompress that image in memory and that takes a lot of memory. More than 6 megabytes. Still, it might work, but you’ll probably just get an out of memory error.

    If you do, then you can increase the amount of allowed memory (most hosts default PHP to 8 meg), but that depends on whether your host lets you do that or not.

    Honestly, you’d be better off resizing the images down to a more reasonable size before posting them. Do you really need a full 3000×2000 image in a post? That won’t fit on most people’s screens.

    Thread Starter jackfussell

    (@jackfussell)

    Where do I add the code into the file? Will anywhere do or a specific spot?
    Sorry…kind of new to the whole code thing.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Preferably at the beginning, right after the “<?php” line.

    If you don’t have a functions.php file in your theme, create a new one which starts with <?php and ends with ?> and has nothing outside of those tags (even blank lines!)

    Thread Starter jackfussell

    (@jackfussell)

    Thanks! That got it to work. Two more questions…
    How do I change the size of the thumb…it’s kind of small?

    If I want to change the resolution prior to uploading…how do I do that?
    Thanks!

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    How do I change the size of the thumb…it’s kind of small?

    function custom_thumbnail_size() {
    return 128; // or whatever you want
    }
    add_filter('wp_thumbnail_max_side_length','custom_thumbnail_size');

    The “128” will be the size of the long side of the thumbnail. The short side will be scaled accordingly, to keep the picture in the right proportions.

    If I want to change the resolution prior to uploading…how do I do that?

    By using your favorite photo editing program, of course. Photoshop, IrfanView, Picasa, whatever you like. Resize the picture, save it as a new image (don’t overwrite the original!) and upload it.

    Thread Starter jackfussell

    (@jackfussell)

    Thanks for the help. It solved my issue.
    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Need help …not creating thumbnails’ is closed to new replies.