This is my first time toying with wp_insert_attachment; I need to mass-import several hundred images from a custom system. That said, the error is probably my fault and not a bug.
Media Settings: 220x121 Thumbnail, 500x500 Medium, 1024x1024 Large.
Here's what I'm trying:
$filename = $_SERVER['document_root'].'/wp-content/uploads/2009/05/conkle01.jpg';
$attachment = array(
'guid' => $filename,
'post_title' => 'file'. time(),
'post_content' => '',
'post_type' => 'attachment',
'post_parent' => 288,
'post_mime_type' => 'image/jpeg'
$attach_id = wp_insert_attachment($attachment, $filename, 288);
$attach_data = wp_generate_attachment_metadata($attach_id, $filename);
The image uploads to the Media management tab, but Scissors throws a Divison by Zero error. Have I missed a parameter for the $attachment object? Some other bonehead move on my part?