Skip to content

A simple previewer server for create thumbnail images from files

Notifications You must be signed in to change notification settings

darkyelox/file-previewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 File previewer 🖼️

Simple file previewer service using ffmpeg, imageMagick and unoconv with LibreOffice for generate images from almost any file supported by these libraries.

It can accept a local file (relative to a volume) or a remote file using HTTP.

💡 Motivation

There are already some libraries and Docker images that do the same thing (and are more dynamic) but I wanted to create something new and simpler, furthermore it supports remote and local files using the same GET request.

🚀 Usage

It listens by using the port 8080 by default and uses a volume for search local files so simply run this as a container:

$ docker run -p 8080:8080 -v /path/to/files/in/server:/storage:ro -d aorius/file-previewer

Then you can use the api GET /preview-file/(file path or http)/WIDTHxHEIGHT.

Examples:

Note: The document files like PDF and DOCX are processed in secuencial using a Mutex, this will be fixed in next commits.

✏️ TODO:

  • ⬜️| Configuration by ENV.

  • ⬜️| Support for GIF files.

  • ⬜️| Enable concurrency for unoconv conversions because of this issue

  • ⬜️| More options for converting some kind of files (background color and line color for audio file waveform)

  • ⬜️| Create APIs for especific files: Ex. /preview-document, /preview-image, etc. This could be a good idea for to be more dynamic.

  • ⬜️| Implement a better cache mechanism. Right now the files are saved in a /tmp/cache folder without any configuration for expiressness.

❓ Maybe

  • Right now the code is very simple. Using express an other nodejs libraries, if the project increase in complexity I could consider using python and a web framework like http://falconframework.org/ or something.

PRs are welcome. 😄

Thanks to:

About

A simple previewer server for create thumbnail images from files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published