WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Image size limitation? (5 posts)

  1. Galyn
    Member
    Posted 7 years ago #

    I was wondering if anyone has come across this...

    One of my images I uploaded using the uploads section in WP did not have a thumbnail. However all my other images did. The only thing that I saw that was different was that this was a rather large image @ 2048x1536. I resized it to 1024x768 and reuploaded it and it created a thumbnail for it. Is there a limit to the size an image can be for the thumbnail creation to work?

  2. drmike
    Member
    Posted 7 years ago #

    I believe it to be 1 meg in filesize where a thumbnail isn't generated. It was put in to limit strain on shared servers.

  3. Galyn
    Member
    Posted 7 years ago #

    Really? That's strange because the image is only 648k...

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    The limitation is 3 megapixels or above. Yes, megapixels, not filesize.

    2048x1536 = 3145728 = exactly 3 megapixels. Anything that big or bigger it does not try to create a thumbnail for. The reason is memory consumption.. Most standard PHP setups will run out of available memory attempting to do that.

    The limitation is easy to remove though. This code would do it:

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

    Put that in a theme's functions.php or a plugin and the limit is gone. But don't blame me if you get out of memory errors when uploading big pics.

  5. Galyn
    Member
    Posted 7 years ago #

    Or, I'll just resize them first. No biggy, I was just wondering what the limitation was... didn't see it in the Docs...

    Thanks for the quick reply.

Topic Closed

This topic has been closed to new replies.

About this Topic