@medialit/thumbnail v0.0.4
Introduction
Create thumbnails from your image and video files for your Node.js based application.
The generated thumbnails are going to be of 16:9 aspect ratio.
For generating thumbnails, this package uses ffmpeg (for videos) utilities, so make sure that is installed on your machine before using this package.
Note: This module will always overwrite the thumbnail file, if already exists.
Features
- Promise based API
- Supports both images and videos
Install
npm install @medialit/thumbnailNOTE: You need to have the following softwares installed on your machine to use this package. For Ubuntu, the command is listed.
apt install ffmpegUsage
With default options
const mt = require('@medialit/thumbnail')
mt.forImage(
'./path/to/file.png',
'./path/to/thumb.png')
.then(() => console.log('Success'), err => console.error(err))API
forImage(source, destination, options)
source
An absolute or relative path to the original image.
destination
An absolute or relative path to the thumbnail folder.
forVideo(source, destination, options)
source
An absolute or relative path to the original video.
destination
An absolute or relative path to the thumbnail folder.
Debugging
Set the environment variable DEBUG to true to see logs.
7 months ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago