| 1 | # shrink |
| 2 | |
| 3 | JPEG compression + resize via stdlib `image` plus `golang.org/x/image/draw` |
| 4 | for Catmull-Rom scaling. |
| 5 | |
| 6 | ## Install |
| 7 | |
| 8 | **Homebrew:** |
| 9 | |
| 10 | ```bash |
| 11 | brew install stevedylandev/tap/shrink |
| 12 | ``` |
| 13 | |
| 14 | **Curl install (Linux/macOS):** |
| 15 | |
| 16 | ```bash |
| 17 | curl -fsSL https://raw.githubusercontent.com/stevedylandev/andromeda/main/install.sh | sh -s -- shrink |
| 18 | ``` |
| 19 | |
| 20 | **PowerShell (Windows):** |
| 21 | |
| 22 | ```powershell |
| 23 | & ([scriptblock]::Create((irm https://raw.githubusercontent.com/stevedylandev/andromeda/main/install.ps1))) shrink |
| 24 | ``` |
| 25 | |
| 26 | **Prebuilt binary:** Grab the right archive from the [releases page](https://github.com/stevedylandev/andromeda/releases?q=shrink%2F) and drop the binary somewhere on your `$PATH`. |
| 27 | |
| 28 | **From source:** |
| 29 | |
| 30 | ```bash |
| 31 | git clone https://github.com/stevedylandev/andromeda |
| 32 | cd andromeda/apps/shrink |
| 33 | go build . |
| 34 | ``` |
| 35 | |
| 36 | ## Quickstart |
| 37 | |
| 38 | ```bash |
| 39 | cp .env.example .env |
| 40 | go run . |
| 41 | ``` |
| 42 | |
| 43 | ### Environment Variables |
| 44 | |
| 45 | | Variable | Default | Description | |
| 46 | |---|---|---| |
| 47 | | `HOST` | `127.0.0.1` | Bind host | |
| 48 | | `PORT` | `3000` | Server port | |
| 49 | |
| 50 | ## Routes |
| 51 | |
| 52 | - `GET /` — upload UI |
| 53 | - `POST /compress` — multipart upload (`file`, `quality` 1-100, optional `width`) |
| 54 | - `GET /static/*` — embedded assets |
| 55 | - `/assets/*` — darkmatter css/fonts |
| 56 | |
| 57 | ## Notes |
| 58 | |
| 59 | JPEG EXIF metadata is preserved after recompression, with GPS data stripped. |
| 60 | Upload limit 20 MB. |