Support » Fixing WordPress » Upload not creating thumbnails for bigger image files

  • Hi,

    when I use the included upload function for uploading images to my posts everything works good when using “smaller” photos (I tried in my test with a 2MP,300KB .jpg file). A thumbnail is created in this case.

    Though when I use “bigger” pictures (5MP, 1,5MB .jpg file) I only have the option to use the picture in full size. No thumbnail is created.

    So the upload feature is nearly unuseable because displaying a full 5MP of course breaks the whole site. A thumbnail would be more useful here.

    Any help is highly appreaciated, thanks for your answers!

    Maschine

Viewing 8 replies - 1 through 8 (of 8 total)
  • IIRC, anything over a meg doesn’t get a thumbnail generated. It’s a server strain issue. Megapixels don’t come into play.

    Hi drmike,

    thanks for answering! Do you know by chance where one could disable the 1MB limit? The upload function is used rarely, so the server won’t be stressed that much…

    Maschine

    Hi Maschine,

    http://wordpress.org/support/topic/103044?replies=5

    That topic provides information about removing the size limit (according to that thread there is a 3MP limit on images).

    But, its not the only potential problem. I’ve just been trying to fix my site. Some images would generate thumbnails and some wouldn’t (even though they were well inside the maximum size talked about in the topic above).

    My server had the default PHP memory limit (8M) so when it came to loading the image to generate the thumbnail it just died. I just increased it (memory_limit in php.ini) and now all my images are generating thumbnails.

    Hope this helps.

    AthenaOfDelphi

    Hey AthenaOfDelphi,

    thanks for your reply! I changed the line in the code according to your link, but now all I get for bigger pictures is “500 – Internal Server error” :-/

    I have no access to the php.ini file, so I tried to change values with ini_set(), but also here only error 500.

    Well, it seems that I have to resize my images in the future before uploading.

    Thanks anyway!
    Maschine

    How did you edit the file? You probably did it in something that formatted the file when you saved it. Make sure you do it in something like Notepad and save it as ANSI or UTF-8

    Well, even after editing the file I had NO error on smaller images (I tested with 2MP). So I think the formatting should not be the problem?!?

    Hmm, anyhting in the server error logs?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    IIRC, anything over a meg doesn’t get a thumbnail generated. It’s a server strain issue. Megapixels don’t come into play.

    Huh. Oddly enough, it is a megapixel issue. I wouldn’t have guessed that either, but it’s the width*height that’s being compared against here.

    The reason for this appears to be simply that it has to load the whole freakin’ image into memory as, basically, a bitmap. Then it creates a resized version of it. However, PHP is often memory limited on servers and such.

    A better way to raise the limit than hacking the core files would be something like this:

    function raise_image_size_limit() {
    return 8*1024*1024; // or whatever you want
    }
    add_filter('wp_thumbnail_creation_size_limit','raise_image_size_limit');

    But, if raising that value doesn’t work and you get 500 server errors, then likely you’re running out of RAM. Most PHP setups are limited to 8 MB. You may need to get your host to up it to 16 MB or more.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Upload not creating thumbnails for bigger image files’ is closed to new replies.