image_make_intermediate_size() broken? Doesn't make thumbnails.
-
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
- The topic ‘image_make_intermediate_size() broken? Doesn't make thumbnails.’ is closed to new replies.