Title: image_make_intermediate_size() broken? Doesn&#039;t make thumbnails.
Last modified: August 20, 2016

---

# image_make_intermediate_size() broken? Doesn't make thumbnails.

 *  [brighthelix](https://wordpress.org/support/users/brighthelix/)
 * (@brighthelix)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/image_make_intermediate_size-broken/)
 * Hello everyone, this is my first post here.
 * I am hoping to get some help with generation of thumbnails for an image in the
   upload folder.
 * I’ve read every post on wp_insert_attachment(), wp_generate_attachment_metadata(),
   and wp_update_attachment_metadata() and tried everything, but I cannot get the
   thumbnails to generate, and I think it’s because something is going wrong with
   the image_make_intermediate_size() function.
 * I believe I’ve traced the error to the image.php file and wp_generate_attachment_metadata()
   function, which calls:
 *     ```
       $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
       echo $resized;
       ```
   
 * I put in the echo, and even though I’ve verified that $file, $size_data are all
   specified and valid arguments, the image_make_intermediate_size() function never
   creates the thumbnail or returns “false” either, for that matter.
 * I’ve checked directory permissions, they are 755 on that folder. I’m using standard
   code to call the thumbnail creation functions:
 *     ```
       // Create post object
       $my_post = array(
         'post_title'  => 'Title.',
         'post_content'  => 'This is my post.',
         'post_status'   => 'inherit',
         'post_author'   => $post_user,
         'post_parent'   => $post_parent,
         'post_mime_type' => 'image/jpeg',
         'post_type' => 'attachment',
         'guid' => $filepath,
       );
       $attach_id = wp_insert_attachment( $my_post, $filepath, $post_parent );
       $attach_data = wp_generate_attachment_metadata( $attach_id, $filepath );
       wp_update_attachment_metadata( $attach_id,  $attach_data );
       ```
   
 * Any ideas why the image_make_intermediate_size() function seems not to be working?
   Thanks!
    Shawn

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [brighthelix](https://wordpress.org/support/users/brighthelix/)
 * (@brighthelix)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/image_make_intermediate_size-broken/#post-3413873)
 * I know the thumbnails can be generated correctly on that server, because my gravity
   forms installation is able to create images, thumbnails, and the correct metadata.
 *  Thread Starter [brighthelix](https://wordpress.org/support/users/brighthelix/)
 * (@brighthelix)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/image_make_intermediate_size-broken/#post-3413938)
 * Hello, anyone around?
 *  Thread Starter [brighthelix](https://wordpress.org/support/users/brighthelix/)
 * (@brighthelix)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/image_make_intermediate_size-broken/#post-3413984)
 * Okay, figured it out!
 * The reason it was happening was because I was specifying the filepath argument
   to wordpress as:
 * $wp_upload_dir[‘url’]
    Returning the absolute path with [http://](https://wordpress.org/support/topic/image_make_intermediate_size-broken/?output_format=md).
   Somehow WordPress was never able to find the file.
 * now I use:
    $wp_upload_dir[‘path’] Which returns the absolute path with /home/
   etc… Wordpress likes this better.
 * Anyone know why?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘image_make_intermediate_size() broken? Doesn't make thumbnails.’ is closed
to new replies.

## Tags

 * [thumbnails](https://wordpress.org/support/topic-tag/thumbnails/)
 * [wp_generate_attachment_metadata](https://wordpress.org/support/topic-tag/wp_generate_attachment_metadata/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 1 participant
 * Last reply from: [brighthelix](https://wordpress.org/support/users/brighthelix/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/image_make_intermediate_size-broken/#post-3413984)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
