Sign inSign up

liquidinvestigations/preview-service

By liquidinvestigations

Updated over 4 years ago

build of preview-service with gunicorn and strict request timeout

Image
Security
API management
Content management system
0

1.1K

liquidinvestigations/preview-service repository overview

Liquid Investigations

This Repository is part of Liquid Investigations.


preview-service

License: MIT Travis

Super slim webservice to generate thumbnail images for document files (pdf, odt, doc, docx), video files (mp4, flv, webm, ogv, wmv), 3D Files (ply, obj, stl) and many more using a simple HTTP API.

This is a simple wrapper around algoo/preview-generator.

See the full list of supported file formats.

Usage

Boot up the service:

docker run -p 8000:8000 fpurchess/preview-service

Use it to create a thumbnail:

curl -o thumbnail.jpeg -F 'file=file_to_preview.pdf' http://localhost:8000/preview/100x100

Optional Volumes

  • /tmp/cache/ - mount it to persist thumbnail cache
  • /tmp/files/ - stores all uploaded files

Here's a full example:

docker run -p 8000:8000 -v /tmp/cache/:/tmp/cache/ -v /tmp/files/:/tmp/files/ fpurchess/preview-service

API

GET /

Returns 200 OK when the service is up and running.

POST /preview/{width}x{height}

Awaits a the file to be converted in a multipart/form-data with form name file. Returns the converted file as a file response if the conversion is successful.

curl -o thumbnail.jpeg -F 'file=file_to_preview.pdf' http://localhost:8000/preview/100x100

Creates a 100x100 JPEG thumbnail image of file_to_preview.pdf and stores it in thumbnail.jpeg.

GET /cache/<cached-file>

Returns a cached converted file if present.

Thanks

Thanks algoo and all contributors of algoo/preview-generator.

LICENSE

see LICENSE file

Tag summary

Content type

Image

Digest

Size

1.3 GB

Last updated

over 4 years ago

docker pull liquidinvestigations/preview-service:0.4.0-liquid-2