2.0.1 • Published 6 years ago

xdg-thumbnails v2.0.1

Weekly downloads
2
License
GPL-3.0+
Repository
github
Last release
6 years ago

xdg-thumbnails

Generate file thumbnails (image previews) with system workers using freedesktop.org DBus specification

Installation

npm install xdg-thumbnails

Usage

const thumbnailer = new (require('xdg-thumbnails').Thumbnailer);

thumbnailer.connect((error) => {
	if (error)
		return console.error(error);

	thumbnailer.queueFile('image.jpg', (error, path) => {
		if (error)
			return console.error(error);

		console.log(`Newly generated thumbnail: ${path}`);
	});

	// or, with options

	thumbnailer.queueFile({
		file_path: 'image.jpg',
		scheduler: 'default',  // Options: 'background', 'default', 'foreground'
		flavor:    'normal',   // Options: 'large', 'normal'
	}, (error, path) => {
		if (error)
			return console.error(error);

		console.log(`Newly generated thumbnail: ${path}`);
	});
});
2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

9 years ago