Title: Invalid Argument
Last modified: August 19, 2016

---

# Invalid Argument

 *  [Limay](https://wordpress.org/support/users/limay/)
 * (@limay)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/invalid-argument-2-2/)
 * I have been using the same WordPress theme for about 2 years now. Today when 
   I tried to upload a photo I got the following message:
 * Warning: Invalid argument supplied for foreach() in /home/charmcit/public_html/
   wp-admin/includes/image.php on line 126
 * Can anyone tell me why I can no longer upload when posting? Thanks!

Viewing 1 replies (of 1 total)

 *  [jon](https://wordpress.org/support/users/adiant/)
 * (@adiant)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/invalid-argument-2-2/#post-1680400)
 * The assumption here is that you are using WordPress Version 3.0.1.
 * I don’t know why it suddenly stopped working, but you should check lines 124 
   to 128 of /wp-admin/includes/image.php and be sure they read exactly as follows:
 *     ```
       foreach ($sizes as $size => $size_data ) {
                   $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
                   if ( $resized )
                       $metadata['sizes'][$size] = $resized;
               }
       ```
   
 * If you don’t have any way to figure out line numbers, NotePad++ is a free editor
   that shows line numbers. [http://notepad-plus-plus.org/](http://notepad-plus-plus.org/)
 * This code is part of a function that is creating information about the thumbnail
   that has been generated of your picture.

Viewing 1 replies (of 1 total)

The topic ‘Invalid Argument’ is closed to new replies.

## Tags

 * [invalid argument](https://wordpress.org/support/topic-tag/invalid-argument/)
 * [Upload photo](https://wordpress.org/support/topic-tag/upload-photo/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [jon](https://wordpress.org/support/users/adiant/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/invalid-argument-2-2/#post-1680400)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
