thumbnails

package module
v0.0.0-...-ca9d3ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

Thumbnails

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.

Installation

To install the Thumbnails tool, use the following command:

go get github.com/jempe/thumbnails

Usage

The Thumbnails tool requires a configuration file and an image file to generate thumbnails. You can specify these files using command-line flags.

Command-Line Flags
  • -config: Path to the configuration file (default: thumbnails.json).
  • -image: Path to the image file.
Example

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

Configuration

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"
}

Error Handling

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.

Contributing

If you would like to contribute to the project, please fork the repository and submit a pull request. We appreciate your contributions!

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(file string) (err error)

func CopyImage

func CopyImage(image string, thumb_file string) error

func Exists

func Exists(file string) bool

check if file exists

func Generate

func Generate(image string, overwrite bool) (err error)

Generate thumbnails if image is empty generate all thumbnails

func IsDirectory

func IsDirectory(path string) bool

func IsImage

func IsImage(image_path string) bool

check if file is an image

Types

This section is empty.

Directories

Path Synopsis
cmd
gothumbnails command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL