10000 GitHub - patzj/file-preview-generator-api: A containerized API for generating thumbnail previews of supported files.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

patzj/file-preview-generator-api

Repository files navigation

File Preview Generator API

A containerized service for generating file previews of supported files. This uses the preview-generator python library to generate the file previews and Celery to spawn worker(s) to do the processing. This isolates the "task" of generating the file previews from the web server receiving the requests.

Basic Usage

This requires a running Docker Engine (or Daemon) and Compose tool.

docker-compose up -d

Requesting for Preview

This will return a task_id that can be used to check the status of the process and download the result of the process.

curl -F "file=@/path/to/image.jpg" localhost:5000/generate

Checking the Status

A SUCCESS status indicates that the preview is ready to be downloaded. Please see Celery Built-in States for more info.

curl localhost:5000/status/<task_id>

Downloading the Preview

As stated from the Checking the Status section, the file is ready to be downloaded once the status is SUCCESS.

curl -o preview.jpg localhost:5000/download/<task_id>

About

A containerized API for generating thumbnail previews of supported files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0