I'm migrating a relatively small custom portal (roughly 10k posts) to wordpress. Problem is that I want to migrate the pictures aswell. I want to insert every picture from source to the post's gallery.
I have managed to do that with wp_insert_attachment. Basically I have moved everything by now, but the images I'm uploading have silly names (md5 hashes). Also I'm resizing the images to thumbnail (150x150), medium (300x300) etc sizes with manually created and serialized meta data (so that when I pop up my gallery within a post I can see also the smaller sizes).
Question: is there some wp-native way to do this process? like wp_insert_image_attachment($postid, $imageurl) - which would take the image from one directory, process it for all sizes possible, create metadata and put it to the proper place?