diff --git a/dev/README.md b/dev/README.md index 2ec39e467..2ea16c39e 100644 --- a/dev/README.md +++ b/dev/README.md @@ -11,3 +11,10 @@ The highway shield [color palette](americana.gpl) can be imported into Inkscape 3. Import [americana.gpl](americana.gpl). 4. Restart Inkscape. 5. Click the ◀ button to the right of the color palette strip at the bottom of the window (or in the top-right corner of the Color Palette panel), then choose americana.gpl from the menu. + +## Map sample images + +Map sample images can be generated with a script. See [sample_locations.json](test/sample_locations.json) for the format. + +1. Create a JSON file with the map location and clipping rectangles +2. Run the generate_samples script and pass the JSON file location: `npm run generate_samples -- test/sample_locations.json`` diff --git a/scripts/generate_samples.ts b/scripts/generate_samples.ts index 0d47d0b73..f9b920dc0 100644 --- a/scripts/generate_samples.ts +++ b/scripts/generate_samples.ts @@ -35,9 +35,12 @@ const loadSampleLocations = (filePath: string): SampleSpecification[] => { const sampleFolder = "./samples"; -const screenshots: SampleSpecification[] = loadSampleLocations( - "test/sample_locations.json" -); +const jsonSampleLocations = process.argv[2] || "test/sample_locations.json"; + +console.log(`Loading sample locations from ${jsonSampleLocations}`); + +const screenshots: SampleSpecification[] = + loadSampleLocations(jsonSampleLocations); fs.mkdirSync(sampleFolder, { recursive: true });