Metadata-Version: 2.4
Name: ezipress
Version: 202601210707
Summary: File image re-compression tool - supports ZIP, RAR, EPUB format image compression processing
Author-email: Sam Weng <eyes1971@gmail.com>
Maintainer-email: Sam Weng <eyes1971@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/eyes1971/ezipress
Project-URL: Documentation, https://ezipress.readthedocs.io/
Project-URL: Repository, https://github.com/eyes1971/ezipress
Project-URL: Bug Tracker, https://github.com/eyes1971/ezipress/issues
Project-URL: Changelog, https://github.com/eyes1971/ezipress/blob/main/CHANGELOG.md
Keywords: compression,image,zip,rar,epub,optimization,batch processing,file processing,image compression,file processing
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: System :: Archiving :: Compression
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow>=9.0.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: scikit-fuzzy>=0.4.0
Requires-Dist: colorama>=0.4.0; sys_platform == "win32"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: isort>=5.10.0; extra == "dev"
Requires-Dist: flake8>=5.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=2.20.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=5.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
Requires-Dist: myst-parser>=0.18.0; extra == "docs"
Provides-Extra: full
Requires-Dist: rarfile>=4.0; extra == "full"
Requires-Dist: colorama>=0.4.0; extra == "full"
Provides-Extra: windows
Requires-Dist: colorama>=0.4.0; extra == "windows"
Requires-Dist: pywin32>=304; sys_platform == "win32" and extra == "windows"
Provides-Extra: rar
Requires-Dist: rarfile>=4.0; extra == "rar"
Dynamic: license-file

# ezipress - File Image Re-compression Tool

A file image re-compression tool that supports ZIP, RAR, and EPUB format image compression processing.

## Features

- **Multi-format Support**: Supports ZIP, RAR, and EPUB file formats
- **Smart Compression**: Automatically detects and compresses image files
- **Quality Control**: Configurable JPEG/WEBP quality parameters
- **Batch Processing**: Supports batch processing of large numbers of files
- **Compression Markers**: Adds compression markers to processed EPUB files to avoid reprocessing
- **Backup Mechanism**: Automatically creates backups and can restore on processing failure

## Installation

### System Requirements

- Python 3.8+
- Linux/macOS/Windows

### Installation Steps

```bash
# Install from PyPI
pip install ezipress

# Or install from source
git clone https://github.com/eyes1971/ezipress.git
cd ezipress
pip install -e .
```

### Optional Dependencies

```bash
# Install RAR support
pip install ezipress[rar]

# Install full functionality (includes all optional dependencies)
pip install ezipress[full]

# Install development dependencies
pip install ezipress[dev]
```

## Usage

### Basic Usage

```bash
# Compress a single file
ezipress file.zip

# Compress multiple files
ezipress file1.zip file2.epub file3.rar

# Process all supported files in a directory
ezipress /path/to/directory/

# Recursively process subdirectories
ezipress -r /path/to/directory/
```

### Advanced Options

```bash
# Set target file size (KB)
ezipress -t 1024000 file.zip

# Set JPEG quality (1-100)
ezipress -q 85 file.zip

# Set PNG to JPG threshold (KB)
ezipress -p 300 file.zip

# Enable debug mode
ezipress --debug file.zip
```

### Command Line Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `-t, --target-size` | Target file size (KB) | - |
| `-m, --min-size` | Skip images smaller than this size (KB) | 240 |
| `-q, --quality` | JPEG/WEBP quality reference value (1-100) | 95 |
| `-p, --png-to-jpg-threshold` | PNG to JPG threshold (KB) | 500 |
| `--webp-to-jpg-threshold` | WEBP to JPG threshold (KB) | 1024 |
| `-r, --recursive` | Recursively process subdirectories | No |
| `-f, --force` | Force recompression of marked EPUB files | No |
| `-s, --skip-compressed` | Automatically skip compressed EPUB files | No |
| `--add-marker` | Add compression markers to processed EPUB files | Yes |
| `--no-backup` | Do not keep backups of original files | No |
| `--workers` | Number of parallel worker processes | CPU cores |
| `--debug` | Enable debug mode | No |

## Project Structure

```
src/
├── cli.py              # Command line interface
├── main.py             # Main program logic
├── config.py           # Configuration management
├── typing.py           # Type definitions
├── archive/            # File format handlers
│   ├── epub_handler.py # EPUB handler
│   ├── zip_handler.py  # ZIP handler
│   ├── rar_handler.py  # RAR handler
│   └── marker.py       # Compression marker management
├── compressor/         # Image compression core
│   ├── core.py         # Compression core logic
│   ├── strategy.py     # Compression strategy
│   └── exceptions.py   # Custom exceptions
├── controller/         # Processing controllers
│   └── batch_controller.py    # Batch processing controller
├── display/            # Display interface
│   └── legacy_output.py # Traditional text output
└── utils/              # Utility functions
    ├── logger.py       # Logging management
    └── file_utils.py   # File utilities
```

## Development

### Setting up Development Environment

```bash
# Install development dependencies
pip install -e .[dev]

# Run tests
pytest

# Format code
black src/
isort src/

# Check code
flake8 src/
mypy src/
```

### Building Release Version

```bash
# Build release version
python -m build

# Upload to PyPI
twine upload dist/*
```

## License

This project is licensed under the MIT License.

## Contributing

Issues and Pull Requests are welcome!

## Contact Information

- Author: Sam Weng
- Email: eyes1971@gmail.com
- Project Homepage: https://github.com/eyes1971/ezipress

