Update documentation

This commit is contained in:
Justin Hawkins 2024-06-04 08:48:33 +09:30
parent 75027684ec
commit 69b3360d79
2 changed files with 41 additions and 5 deletions

View File

@ -19,9 +19,46 @@ the top left tile.
## Usage
slicerdicer --help
slicerdicer -help
slicerdicer --filename foo.png --tile-size 256 --concurrency 5
slicerdicer -filename large_image.png -tile-size 256 -concurrency 5
## Output filenames
The destination for the tiles can be changed with the `-basename` and
`-path-template` options. The path template must contain 5 placeholders,
in the following order:
* `%s` basename, as per `-basename` (default `tile`)
* `%d` zoom level
* `%d` 'x' coordinate
* `%d` 'y' coordinate
* `%d` file format (jpg or png)
The default template is `%s-%d-%d-%d.%s` which results in a flat structure
with all files in the current directory.
For example, using `-basename map` and
`-path-template '%s/zoom-%d/%d-%d.%s'` will result in a file structure like:
map
├── 0
│   └── 0-0.png
├── 1
│   ├── 0-0.png
│   └── 1-0.png
└── 2
├── 0-0.png
├── 0-1.png
├── 1-0.png
├── 1-1.png
├── 2-0.png
├── 2-1.png
├── 3-0.png
└── 3-1.png
All tiles in a directory called `map`, with a second level directory for zoom
level, each file named `x-y.png` within that.
## Notes

View File

@ -234,7 +234,6 @@ func tileWorker(jobs <-chan tileJob, results chan<- string) {
writer, err := j.output.CreatePathAndFile(output_filename)
if err != nil {
log.Fatalf("could not create path/file: '%s'", err.Error())
panic(err)
}
if j.format == "png" {
err = png.Encode(writer, cropped)