renovate[bot] d3b3a73b8f chore(deps): update anchore/sbom-action action to v0.18.0 (#37)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 20:47:16 +00:00
2024-08-27 08:56:38 -04:00
2024-12-06 17:28:09 -05:00
2024-12-06 17:28:09 -05:00
2024-12-06 17:28:09 -05:00
2024-12-06 17:28:09 -05:00
2024-08-26 22:48:23 -04:00
2024-12-06 17:10:52 -05:00
2024-12-06 18:00:24 -05:00
2024-08-27 09:20:43 -04:00
2024-12-06 17:28:09 -05:00
2024-12-06 17:01:00 -05:00
2024-09-09 14:09:23 -04:00

CBZOptimizer

CBZOptimizer is a Go-based tool designed to optimize CBZ (Comic Book Zip) files by converting images to a specified format and quality. This tool is useful for reducing the size of comic book archives while maintaining acceptable image quality.

Features

  • Convert images within CBZ files to different formats (e.g., WebP).
  • Adjust the quality of the converted images.
  • Process multiple chapters in parallel.
  • Option to override the original CBZ files.
  • Watch a folder for new CBZ files and optimize them automatically.

Installation

  1. Clone the repository:
git clone https://github.com/belphemur/CBZOptimizer.git
cd CBZOptimizer
  1. Install dependencies:
    go mod tidy
    

Usage

Command Line Interface

The tool provides CLI commands to optimize and watch CBZ files. Below are examples of how to use them:

Optimize Command

Optimize all CBZ files in a folder recursively:

go run main.go optimize [folder] --quality 85 --parallelism 2 --override --format webp --split

Watch Command

Watch a folder for new CBZ files and optimize them automatically:

go run main.go watch [folder] --quality 85 --override --format webp --split

Flags

  • --quality, -q: Quality for conversion (0-100). Default is 85.
  • --parallelism, -n: Number of chapters to convert in parallel. Default is 2.
  • --override, -o: Override the original CBZ files. Default is false.
  • --split, -s: Split long pages into smaller chunks. Default is false.
  • --format, -f: Format to convert the images to (e.g., webp). Default is webp.

Testing

To run the tests, use the following command:

go test ./... -v

Requirement

Needs to have libwep installed on the machine if you're not using the docker image

Docker

ghcr.io/belphemur/cbzoptimizer:latest

GitHub Actions

The project includes a GitHub Actions workflow to run tests on every push and pull request to the main branch. The workflow is defined in .github/workflows/go.yml.

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

License

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

Description
CBZOptimizer is a Go-based tool designed to optimize CBZ (Comic Book Zip) files by converting images to a specified format and quality. This tool is useful for reducing the size of comic book archives while maintaining acceptable image quality.
Readme GPL-3.0 77 MiB
Languages
Go 98.8%
Dockerfile 1.2%