Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Thumbnailer

⚠️ Disclaimer

This is a Github Copilot experiment. I have written almost nothing of this myself. I did a couple of small bugfixes and this disclaimer in the README. The rest of this repo was generated by GitHub Copilot.

I started by asking copilot to guide me through making a thumbnail CLI in Golang step by step. I gave it a small specification to start with and told it to ask me questions to make sure the result was going to be as good as possible.

It became a never ending guide, the steps of improvement never stopped. I think we started going in circles, just removing and adding about the same functionality back and forth until I managed to snap out of the loop.

I have taken the app for a test spin using three big jpeg files and a cr3, it seems to work as expected 👍🏻

Description

Thumbnailer is a command-line tool for creating thumbnails of images. It supports various image formats and allows for parallel processing to speed up the thumbnail creation process.

Requirements

  • Go 1.16 or later
  • exiftool (for handling Canon CR3 image files)
  • Supported image formats: JPEG, PNG, GIF, BMP, CR3 (with conversion to JPEG)

Supported input image formats

  • JPEG
  • PNG
  • GIF
  • BMP
  • CR3 (Canon RAW, with conversion to JPEG using exiftool)

Supported output image formats

  • JPEG
  • PNG
  • GIF
  • BMP

Installation

  1. Install Go from the official website.

  2. Install exiftool:

    • On macOS: brew install exiftool
    • On Linux: Use your package manager (e.g., sudo apt-get install exiftool for Debian-based systems)
    • On Windows: Download and install from the official website
  3. Clone the repository and navigate to the project directory:

    git clone https://github.com/yourusername/thumbnailer.git
    cd thumbnailer
    go build -o thumbnailer

Usage

Run the thumbnailer command with the required flags:

./thumbnailer -i /path/to/input -o /path/to/output -w 200 -f jpeg -c 75

Flags

  • -i, --input: (required): Path to the input images.
  • -o, --output: (required): Path to save the output thumbnails.
  • -c, --compression: Compression level (1-100) for JPEG output (default: 75).
  • -w, --width: Maximum width of the output thumbnails.
  • -H, --height: Maximum height of the output thumbnails.
  • -f, --format: Output image format (jpeg, png) (default: jpeg).
  • -C, --config: Path to the configuration file.
  • -p, --parallelism: Number of parallel image processing tasks (default: number of CPU cores).

Configuration File

You can also use a JSON configuration file to specify the options. Example config.json:

{
  "input_dir": "/path/to/input",
  "output_dir": "/path/to/output",
  "width": 200,
  "height": 200,
  "format": "jpeg",
  "compression": 75
}

Run the application with the configuration file:

./thumbnailer -C /path/to/config.json

Logging

The application logs its progress and errors to processing.log in the current directory.

Summary report

After processing, a summary report is saved to summary_report.txt in the output directory, detailing the processing times and EXIF data for each image.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址