Metadata-Version: 2.4
Name: pixel-press
Version: 1.0.1
Summary: FastAPI image resizing microservice with recursive batch support
License: MIT License
        
        Copyright (c) 2026 Pixel Press contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi<1.0,>=0.115
Requires-Dist: uvicorn[standard]<1.0,>=0.30
Requires-Dist: python-multipart<1.0,>=0.0.9
Requires-Dist: Pillow<12.0,>=10.4
Provides-Extra: test
Requires-Dist: pytest<9.0,>=8.0; extra == "test"
Requires-Dist: httpx<1.0,>=0.27; extra == "test"
Dynamic: license-file

# Pixel Press

Pixel Press resizes images so their longest side does not exceed a maximum dimension. It keeps the aspect ratio, never enlarges images, and can process individual files, multiple files, or complete folder trees.

## Install

Requires Python 3.10 or newer.

```powershell
python -m pip install pixel-press
```

## Command-line usage

Resize every supported image in a folder and its subfolders:

```powershell
imgresizer --dir .\photos --max-dimension 2048 --output .\resized
```

The directory structure is preserved in the output directory. Images already within the limit are copied unchanged. Images larger than the limit are resized while preserving their aspect ratio.

Useful options:

```text
--dir PATH              Input directory, including subfolders
--output PATH           Output directory (default: <input>_resized)
--max-dimension PIXELS  Maximum longest side (default: 2048)
--verbose               Show debug logging
```

The CLI logs each copied, resized, or skipped file and prints a final summary.

## Web interface

Start the local FastAPI service:

```powershell
imgresizer
```

Open [http://127.0.0.1:8097](http://127.0.0.1:8097) in a browser. The UI supports:

- One image, downloaded directly after processing
- Multiple selected images, downloaded as a ZIP
- A folder drop or folder selection, with subfolders preserved in the ZIP
- A shared maximum-dimension setting

To use another port:

```powershell
imgresizer --port 9000
```

## API

The service exposes an OpenAPI page at [http://127.0.0.1:8097/docs](http://127.0.0.1:8097/docs).

Resize one image:

```powershell
curl.exe -X POST http://127.0.0.1:8097/api/resize `
  -F "file=@.\photos\image.jpg" `
  -F "max_dimension=2048" `
  -o .\resized-image.jpg
```

Resize multiple files and receive a ZIP:

```powershell
curl.exe -X POST http://127.0.0.1:8097/api/resize-folder `
  -F "files=@.\photos\one.jpg" `
  -F "files=@.\photos\two.png" `
  -F "max_dimension=2048" `
  -o .\resized-images.zip
```

## Supported formats

JPEG, PNG, GIF, WEBP, TIFF, BMP, and ICO files are supported. Invalid or unsupported files are skipped during batch processing and reported in the logs.

## License

Pixel Press is released under the [MIT License](LICENSE).
