Step 5: Run the script
Now it's finally time to run the script.
Keep a ruler and the book at hand.
On the command line, go into the directory where the script is (for example, type 'cd /home/yourname/MyBookArtDirectory').
Call the script by entering 'php BookArtGenerator.php'.
Or, if you are running the virtual machine, double-click on the heart icon on the desktop.
The script will now ask some questions.
It will ask
- for the number of the first even page of your book
- for the number of the last even page of your book
- for the height of your book pages (doesn't matter if the unit is cm or inch, only enter the numbers, decimal dot allowed)
- for the name of the picture file (for this example: 'yourpicturefilename.png')
Then it will generate 3 files:
- tempfile.png: This file is for internal use of the script and will be overwritten with every new pattern you make.
- yourpicturefilename_preview.png: This is the preview for you to check that the script has worked as intended.
- yourpicturefilename_pattern.txt: This is the pattern file. It contains the folds for every page - one upper fold and one lower fold.
The files will be saved to the directory where you put the script. On the virtual machine, this is the folder linked from the desktop (MyBookArt).
If you run the script again with a picture of the same name, the last two files will be overwritten, so copy them somewhere else or rename them if you want to keep them.