Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

quicklook-thumbnail

1.0.0 • Public • Published

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
  2. Requirements
  3. Installation
  4. Usage
  5. API
  6. Limitations
  7. Roadmap
  8. Author
  9. License

Supported Platforms

Tested on OSX 10.10 and 10.11

Requirements

Node 4.0.0+

Installation

npm install quicklook-thumbnail --save

Usage

Require the module, then call the asynchronous create() method:

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);
})

API

#create()

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

Limitations

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.

Roadmap

  • Tests

Author

Sidney Bofah

License

MIT

Install

npm i quicklook-thumbnail

DownloadsWeekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar