FitFileSize
v0.3.0Compress PDFs and images, iPhone HEIC too, to fit an upload limit or a form's rules.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
fit_file Fit files under an upload limit
Compress a PDF or image (JPEG, PNG, WebP, TIFF, BMP, or an iPhone HEIC photo, which comes back as a JPEG) on this computer so it fits an upload limit, keeping as much quality as the limit allows, and save the result next to the original as "<name>.fit.<ext>". Give `path` for one file or `paths` for up to 10 that share the same limit. Give either `limit` (like "200KB" or "1.5MB"; KB and MB are 1000-based, so the file passes a check done either way) or `form` (a form preset from list_forms, like "ibps-signature" or "us-visa-photo-ds160", which sets the limit, minimum size and exact pixels that f…
| Parameter | Type | Description |
|---|---|---|
fit | string | When width and height change the shape: "crop" to fill (default) or "pad" with white. |
form | string | A form preset id or name from list_forms, like "ibps-photo". Use this or `limit`. |
height | integer | Exact height in pixels (images only). |
jpeg_ok | boolean | Let a PNG, WebP, TIFF or BMP come back as a JPEG when that is what fits. Only if the upload accepts JPEG; by default every file keeps its format. |
limit | string | Upload limit, like "200KB", "50 KB" or "1.5MB". Use this or `form`. |
minimum | string | Smallest allowed size, like "10KB", for forms that set one. A small JPEG is padded up to it. |
output | string | Where to save the result, with `path` only. Defaults to "<name>.fit.<ext>" beside the original. |
path | string | Full path to the file on this computer ("~/" is allowed). Use this or `paths`. |
paths | array | Full paths to several files that share the same limit, up to 10. Use this or `path`. |
width | integer | Exact width in pixels (images only). |
list_forms List form presets
The upload forms FitFileSize has presets for (visa photos, Indian exam and bank applications, and more), each with its size limit, minimum and pixel size, and the official source of those rules. Pass an id to fit_file as `form`.