WordPress.org

Ready to get started?Download WordPress

Forums

Out of memory in media.php line 258 (5 posts)

  1. cleoni
    Member
    Posted 3 years ago #

    Hi there,
    I have a user-contributed news blog and it keeps on crashing due to an user uploading a image file which is simply very large.

    I get an

    Out of memory Error in media.php line 258

    I have searched the forum a few times but the suggestion to raise memory limit again and again is simply not a solution for me.

    The sofware should not crash and should not eat more and more memory, oterwise we've given to blog contributors an easy way to crash the site.
    A good software could simply avoid displaying/managing the image if it's too large.

    I suggest a fix in media.php or some code somewhere else which limits using images too large (I am not talking here about file size, I mean image size in pixels, which has impact on memory eaten up)

    Any ideas?

  2. Usual pixel size and file size go hand in hand. How large are we talking about?

  3. cleoni
    Member
    Posted 3 years ago #

    One of the images which crashed my blog is this one:

    FOTO-8-LAmore-in-Guerra-1.jpg

    size is 3872x2592

    Obviously, the user who uploaded it is a beginner and has used an image she got straight out from the photo camera.

    It seems that the system crashes while trying to compute a thumbnail of the image. Isn't it possible to detect the image size without actually loading it in memory so that it proceeds only if the image has got a reasonable size?

  4. At 1.5 megs, it's not the file size, sir! You are correct!

    But... It's GD that's doing the crunching, as I recall, and that's probably what's the problem. Ugh.

    I found this old plugin: http://wordpress.org/extend/plugins/resize-at-upload-plus/ it may be a good start?

    Related
    http://core.trac.wordpress.org/ticket/8754
    http://wordpress.org/support/topic/25-imagemedia-uploader-problems

  5. cleoni
    Member
    Posted 3 years ago #

    Hello,
    the plugin is a good idea indeed.

    I tried it, it partially solves the problem in the sense that it crashes exactly the same (most linkely it uses the same resize method) BUT the crashing message can be seen in the uploader window, so the effect is that the user cannot place the image and at least he's got the preception he's doing something wrong.

    I think however the software should not crash like this.
    If it was possible to check the image size beforehand and issue a "image too big" message before attempting to shrink it, it would be the best approach.

    Working on the plugin is better for me than to modify the core code - I will try this myself, thanks for putting me in the right direction.

Topic Closed

This topic has been closed to new replies.

About this Topic