I'm dynamically creating a custom post type in code (not in the editor) and I have an image I want to attach to my custom post type as a post thumbnail, and have it resized, etc. How do I do that. I'm successfully creating the custom post type using wp_insert_post().
I've looked at wp_save_image(), wp_save_image_file(), load_image_to_edit(), get_attached_file() and others, but they all seem to require an image in $_POST. I also looked at wp_insert_attachment() and update_attached_file() which seemed promising, but were not image centric.