Releases: caarmen/image-resizer
Releases · caarmen/image-resizer
Add user_agent query parameter
v0.0.7: Make generated api doc configurable
The following generated documentation urls are exposed. They can be disabled by unsetting their
environment variables.
Documentation type | Environment variable | Default value |
---|---|---|
OpenAPI json | OPENAPI_URL |
/openapi.json |
ReDoc | REDOC_URL |
/redoc |
Swagger UI | DOCS_URL |
/docs |
Example to disable all documentation urls:
Docker:
docker run --detach --env OPENAPI_URL= --env REDOC_URL= --env DOCS_URL= --publish 8000:8000 ghcr.io/caarmen/image-resizer
Local:
OPENAPI_URL= REDOC_URL= DOCS_URL= python -m imageresizer.main
v0.0.6: Add allowed and denied domain lists
Added two environment variables to configure server behavior:
DENIED_DOMAINS
: Requests to resize images on domains in this list will result in a 422 errorALLOWED_DOMAINS
: If non-empty: requests to resize images on domains not in this list will result in a 422 error
v0.0.5: Improve error handling
Manage these error cases:
- Unparseable image url: return 400
- Image url with non-existant domain name: return 422
- Error trying to open the image at the given url: return 422
- Invalid url schema: return 422
- Only https is allowed by default, but this can be overridden with the
SUPPORTED_IMAGE_URL_SCHEMAS
. For example to also support http, setSUPPORTED_IMAGE_URL_SCHEMAS=["https","http"]
- Only https is allowed by default, but this can be overridden with the
v0.0.4: Add `crop` value for `scale_type` query param
If the scale_type
is set to crop
: Resize the image so that it fills the requested size, without distorting the image, but cropping along one axis if the aspect ratio of the source is different from the requested aspect ratio.
v0.0.3: Store `image_format` as integer, and documentation updates
- Use int instead of string for the
image_format
column in the database. - Correct some docstrings.
- Change the way the static doc is generated: use a fixed html file, and pull the
openapi.json
file from the running local server. - Fix the license (it was missing half of a sentence, and it wasn't recognized by GitHub).
v0.0.2: Update README and correct server configuration
Parameters corrections:
- Use consistent naming and default values for
LOG_DIR
andCACHE_DIR
environment variables - Make
docker_remove_containers.bash
delete image resizer Docker containers built locally or downloaded from Github packages - Read
UVICORN_PORT
environment variable for specifying the port
Documentation:
- Add quick start to be able to download the docker image without cloning this repo
- Update documentation to specify how to use environment variables when running the server locally