Command line usage

General

When installing flask-resize with pip you’ll get a command installed along it called flask-resize. See below for the sub commands and what they’re used for.

Usage

usage: flask-resize [-h] {generate,list,sync,clear} ...

Sub-commands:

generate

Generate images passed in through stdin. Return URL for resulting image

Useful to generate images outside of the regular request/response cycle of a web app = happier visitors who don’t have to wait until image processing by Flask-Resize completes. Care has to be taken so that the exact same arguments are passed in as what is specified in code/templates - the smallest difference in passed in options will cause flask resize to generate a new image.

Use GNU Parallel or similar tool to parallelize the generation

flask-resize generate [-h] [-d DIMENSIONS] [-f FORMAT] [-q QUALITY] [-F]
                      [-b BGCOLOR] [-u] [--progressive] [--placeholder]
                      filename
Positional Arguments
filename None
Named Arguments
-d, --dimensions
 None
-f, --format None
-q, --quality

80

Default: 80

-F, --fill

False

Default: False

-b, --bgcolor None
-u, --upscale

True

Default: True

--progressive

True

Default: True

--placeholder

False

Default: False

list

Undocumented

flask-resize list [-h] {cache,images} ...
Sub-commands:
cache

List all items found in cache

flask-resize list cache [-h]
images

List all generated images found in storage backend

flask-resize list images [-h]
sync

Undocumented

flask-resize sync [-h] {cache} ...
Sub-commands:
cache

Syncs paths stored in the cache backend with what’s in the storage backend

Useful when the storage backend destination is shared between multiple environments. One use case is when one has synced generated imagery from production into one’s development environment (for example with aws s3 sync –delete s3://prod-bucket s3://my-dev-bucket). The cache can then be synced with what’s been added/removed from the bucket my-dev-bucket.

flask-resize sync cache [-h]
clear

Undocumented

flask-resize clear [-h] {cache,images,all} ...
Sub-commands:
cache

Clear the cache backend from generated images’ paths

flask-resize clear cache [-h]
images

Delete all generated images from the storage backend

flask-resize clear images [-h]
all

Clear both the cache and all generated images

flask-resize clear all [-h]