Skip to content
EPUB size reduction tool
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
au.org.libraryforall.epubsquash.api
au.org.libraryforall.epubsquash.cmdline
au.org.libraryforall.epubsquash.tests
au.org.libraryforall.epubsquash.vanilla
src/site/resources
README-CHANGES.xml
README-LICENSE.txt
README.md
pom.xml

README.md

epubsquash

Maven Central Maven Central (snapshot)

A tool for making EPUB files smaller.

epubsquash

Features

  • Squash images in EPUBs to reduce file sizes
  • Well designed modular API for use in Java 11+ programs
  • Command line interface

Requirements

  • Java 11+

How To Build

$ mvn clean package

If the above fails, it's a bug. Report it!

Usage

Usage: epubsquash [options] [command] [command options]
  Options:
    --verbose
      Set the minimum logging verbosity level
      Default: info
      Possible Values: [trace, debug, info, warn, error]
  Commands:
    squash      Squash an EPUB file
      Usage: squash [options]
        Options:
          --image-max-height
            The maximum height of images
            Default: 1170.0
          --image-max-width
            The maximum width of images
            Default: 1600.0
        * --input-file
            The EPUB file to squash
        * --output-file
            The output EPUB file
          --verbose
            Set the minimum logging verbosity level
            Default: info
            Possible Values: [trace, debug, info, warn, error]

To squash an epub file /tmp/input.epub, writing the result to /tmp/output.epub:

$ java -jar au.org.libraryforall.epubsquash.cmdline-0.0.1-main.jar \
  squash \
    --input-file /tmp/input.epub \
    --output-file /tmp/output.epub \
    --verbose trace

The epubsquash package uses jcommander to parse command line arguments and therefore also supports placing command line options into a file that can be referenced with @:

$ cat arguments.txt
squash
--input-file
/tmp/input.epub
--output-file
/tmp/output.epub
--verbose
trace

$ java -jar au.org.libraryforall.epubsquash.cmdline-0.0.1-main.jar @arguments.txt
You can’t perform that action at this time.