How would you go about it?
What would be the best way to bulk import thousands of images to existing nodes using node_images?
Do I write a script that reads the files from the filesystem and then use all the node_images hooks to process it?
The nodes exists.
The images are stored in folders names similarly to the title of the nodes.
About 170 nodes and 4000 images.
I'm currently thinking of mapping all the image folders (their path) to a node id manually and put that in a CSV file. Then write a script a bit like http://drupal.org/node/67887 that chews through the CSV file, read all the images in the corresponding folder and run them through a customized function based on node image's _node_images_upload function?
Then I would get the sizes I want. In the folders I want and all that would be inserted into the node_images table without me having to worry about that part?
Comments
Comment #1
petterw commentedThis is how I solved it. Be aware, I don't really know what I am doing yet in terms of Drupal development so use at your own risk.
Comment #2
petterw commentedJust create a new page and put this in the body with input type set to php.