You are here

Calling information from an external text file

I'm trying to figure out how to write a script that will create a mosaic for me from set number of image files.

The idea is that all the component images will open as new layers within a single image, and then a script will go through and set the position of the first image in the stack to the top left, the next image to the coordinates that match up with the right edge of the first image and so on, essentially creating a grid of images.

There are two things that I'm having problems figuring out how to do:

  • I need to allow the user to define the dimensions of the grid (whether it's 4x4 or 5x5, etc).
  • The layers need to be sorted according to their position in the desired output grid. However, the files are not named in a way that makes their ordering obvious. (e.g. the order could be 16, 1, 2, 14)

Ideally, I would like to have it set up so that the user creates a text file that has the proper ordering of the image files as well as the dimensions of the desired mosaic.

Is it possible to read an external file from my script and then use that read input as variables in the script itself?

I've looked at the I/O input functions available in R5RS, but I don't know if they're usable within GIMP scripts or, even if they are, how to implement them in this way.


Subscribe to Comments for "Calling information from an external text file"