Use NodeJS to generate thumbnail images for all QuickLook-enabled filetypes (e.g. .mp4 videos, iMessage transcripts, text files) on Apple OSX.
quicklook-thumbnail
====================================
Use NodeJS to generate thumbnail images for all QuickLook-enabled filetypes (e.g. .mp4 videos, iMessage transcripts, text files) on Apple OSX.
Contents
----
1. Supported Platforms
1. Requirements
1. Installation
1. Usage
1. API
1. Limitations
1. Roadmap
1. Author
1. License
Supported Platforms
----
Tested on OSX 10.10 and 10.11
Node 4.0.0+
``sh`
npm install quicklook-thumbnail --save
Require the module, then call the asynchronous create() method:
`javascript
thumbnail = require('quicklook-thumbnail');
var options = {
size: 256,
folder: '/Users/johnqpublic/Documents'
};
thumbnail.create('/Users/johnqpublic/Desktop/video.mp4', options, function(err, result){
if (err) throw (err);
console.log("Created thumbnail at: " + result);
})
`
`javascript``
create: function (file, options, callback)
Creates a .png image thumbnail of the provided file.
- Parameters
- file (String) - Absolute path to the video file
- options (Object)
- folder (String) - Directory to place the thumbnails (Default: Directory of file)
- size (Number) - Maximum width of the generated images in pixels (Default: 512)
- callback (Function) - Called with result when process terminates
- error (Error)
- path (String) - Absolute path to generated image
This module can only generate thumbnails for files supported by the Apple OS X Quick Look framework. Only PNG is supported as output image format.
Apart from h264 video files in mp4 containers (and many other media files) a multitude of document formats is supported out of the box.
For a list of all supported filetypes, please feel free to refer to Wikipedia.
MIT