Support » How-To and Troubleshooting » Fatal Error when Uploading Pictures to Media Library in 2.5

Fatal Error when Uploading Pictures to Media Library in 2.5

  • I am trying to upload a series of 9 images to make a gallery in my post. This is the error I get on every image.

    Fatal error: Call to undefined function wp_constrain_dimensions() in /home/towingso/public_html/mtbtrailreview/blog/wp-admin/includes/image.php on line 173

    When I look in the file folder on the server…they are in there. When I go to the media library I see this…

    Fatal error: Call to undefined function wp_get_attachment_image() in /home/towingso/public_html/mtbtrailreview/blog/wp-includes/post-template.php on line 386

    Does anyone have any clue of what is happening?

Viewing 15 replies - 1 through 15 (of 19 total)
  • No one? I installed a gallery plug-in for a temporary fix…but I would like to get it resolved.

    wp_get_attachment_image() is defined in /wp-includes/media.php

    I’d suggest checking that all the files were uploaded correctly, so at least re-upload the file mentioned above.

    I am getting the same error and can’t upload images. I tried deleting and copying the file in the error and then tried deleting and copying the wp-includes again. I checked all plugins to make sure they were ok, did any upgrading where available but I am still getting the error. Would love to know if anyone found a fix other than copying files again.

    Any other suggestions?

    I noticed that a file in wp-admin was mentioned in part of the error so I also deleted and re-copied wp-admin but I still get the same error. I have tried copying again a few times so that doesn’t seem to be the fix in my case.

    I have the same problem. When I upload an image, I’m select the file, but the form stops, and the image don’t upload. It shows the message “Crunching” or the name of the file.

    This issue happens when I use Ubuntu with Mozilla 3 Beta 4 or Mozilla

    If I’m use Windows with Mozilla 3 beta 4 this function works well, nothing wrong happens…..????

    Note: I’m from Spain…sorry, my English is very bad

    Same errors here. Can’t get uploads to work with either Firefox or IE under WinXP. Started with WP 2.5. Earlier version worked fine. Is roll back an option?


    Same here, same error. All four files that I’ve uploaded are in the uploads/2008/04 folder, but I can’t reach them from the admin page, only from FTP. Any other ideas?

    I’m also getting the following error when I try and click on the ‘Media Library’ link (it shows I have 2 items in there):

    Fatal error: Call to undefined function: image_downsize() in /hsphere/local/home/XXXXXXXXXX/trowbridgefamily.net/WP/wp-includes/post.php on line 2326

    Any ideas?

    Moderator Samuel Wood (Otto)


    WordPress.org Tech Dude

    Please try these suggestions:

    I get the exact same errors and I have tried every suggestion in the sticky, the non flash uploader comes up with the same error but even faster.

    Same here as Mexxo – I tried the other fixes, but get the same errors as before.

    Is there an issue on the size of the file? I have 7 pictures in the directory now – 6 are around 650K each, and the other is only 82K. when I see the word ‘downsize’ in the function, it leads me to believe that maybe there is some sizing issue involved.

    Moderator Samuel Wood (Otto)


    WordPress.org Tech Dude

    barrydt: If you’re getting “call to undefined function”, then that has only one explanation: Your installation is missing files or has bad permissions on those files.

    See, you’re getting this error: Call to undefined function: image_downsize(). The problem with that is that image_downsize() is not undefined. It exists. It’s on line 55 of /wp-includes/media.php. So either your copy of that file on the server is missing, or it is non-readable for some reason.

    And the kicker is that there is no other explanation. There’s no other way to get that error. So really, truly, look closer at that file. Better yet, reupload ALL the files from the original sources, like it says in step 1 of the sticky, because if you’ve got one bad file you may have more than one bad file.

    We’re really, truly not just making this stuff up as we go along. When you say that you “tried the other fixes” and then say you have an error which we know that those fixes would have solved, then it gets us all a tad frustrated here.

    Thanks, Otto – I know you’re not making things up as you go along, and I’m frustrated, too, as I had done all of the recommended fixes, including reinstalling everything, and it wasn’t working.

    As a last resort, I wiped out the 2.5 zip file, then re-downloaded a new one, unzipped it, and did a new upgrade. Lo and behold, it worked this time! It looks like third time was the charm for me – I guess I just went one step further and started over from the VERY beginning, with a completely new zip file.

    Thanks for your help.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Fatal Error when Uploading Pictures to Media Library in 2.5’ is closed to new replies.