Thumbnails is a Go-based tool for generating thumbnails from images using a specified configuration file. This README provides instructions on how to install, configure, and use the tool.
To install the Thumbnails tool, use the following command:
go get github.com/jempe/thumbnails
The Thumbnails tool requires a configuration file and an image file to generate thumbnails. You can specify these files using command-line flags.
-config
: Path to the configuration file (default:thumbnails.json
).-image
: Path to the image file.
To generate thumbnails using a configuration file and an image file, run the following command:
go run cmd/gothumbnails/main.go -config=path/to/thumbnails.json -image=path/to/image.jpg
The configuration file should be a JSON file that specifies the settings for generating thumbnails. Here is an example of what the configuration file might look like:
{
"thumbnail_sizes": [
{"width": 100, "height": 100},
{"width": 200, "height": 200}
],
"output_directory": "thumbnails"
}
If there are any errors during the configuration or thumbnail generation process, they will be printed to the console. Make sure to check the output for any error messages.
If you would like to contribute to the project, please fork the repository and submit a pull request. We appreciate your contributions!
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.