Git Product home page Git Product logo

file-previewer's Introduction

๐Ÿ” 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:

file-previewer's People

Contributors

darkyelox avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.