Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extractd

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extractd

extract previews from DSLR and Mirrorless cameras RAW files

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
increased by32.26%
Maintainers
1
Weekly downloads
 
Created
Source

extractd

NPM version Downloads CircleCI

Extract previews from DSLR and Mirrorless cameras RAW files.

Installation

npm i extractd

Examples

Multiple examples can be located in examples directory

Usage

Workflow allows to extract previews directly from RAW files. Available options:

  • compact optional (boolean) - returns compact list of the preview files (defaults to false).
  • destination optional (string) - directory where preview image will be saved (defaults to RAW image directory).
  • persist optional (boolean) - by default exif process will be initialised and killed of per extractd call; with persist enabled same exif process can be used across all calls for single file and batch processing (defaults to false).

Basic usage

const extractd = require('extractd');

(async () => {

    const done = await extractd('/directory/nikon_d850_01.nef');

})();

Response done (object) will be similar to:

  {
    preview: '/tempdirectory/nikon_d850_01.jpg',
    source: '/directory/nikon_d850_01.nef'
  }
  • preview - location of the preview image
  • source - location of the original RAW image

Complex usage

const canon = await extractd('/directory/canon_eos_5d_mark_iv_01.cr2', {
  compact: true,
  persist: true
});

const nikon = await extractd('/directory/nikon_d850_01.nef', {
  compact: true,
  persist: true
});

const panasonic = await extractd('/directory/panasonic_s1r_01.rw2', {
  compact: true
});

const done = [canon, nikon, panasonic];

Response done (array) will be similar to:

[
  '/tempdirectory/canon_eos_5d_mark_iv_01.jpg',
  '/tempdirectory/nikon_d850_01.jpg',
  '/tempdirectory/panasonic_s1r_01.jpg'
]

As persist option was used only single exif process was used across all three calls. Last item terminates exif process as persist defaults to false.

Batch usage

const extractd = require('extractd');

(async () => {

    const done = await extractd([
      '/directory/nikon_d850_01.nef',
      '/directory/sony_a7r_iii_01.arw',
      '/directory/pentax_k_1_mark_ii_01.dng'
    ]);

})();

Response done (array) will be similar to:

  [
    {
      preview: '/tempdirectory/nikon_d850_01.jpg',
      source: '/directory/nikon_d850_01.nef'
    },
    {
      preview: '/tempdirectory/sony_a7r_iii_01.jpg',
      source: '/directory/sony_a7r_iii_01.arw'
    },
    {
      preview: '/tempdirectory/pentax_k_1_mark_ii_01.jpg',
      source: '/directory/pentax_k_1_mark_ii_01.dng'
    }
  ]

Advanced usage

const extractd = require('extractd');

(async () => {

    const batch = await extractd([
      '/directory/nikon_d850_01.nef',
      '/directory/sony_a7r_iii_01.arw',
      '/directory/pentax_k_1_mark_ii_01.dng'
    ], {
      persist: true
    });

    const file01 = await extractd('/directory/fujifilm_gfx_50s_01.raf', {
      persist: true
    });

    const file02 = await extractd('/directory/panasonic_s1r_01.rw2');

    const done = [...batch, ...[file01], ...[file02]];

})();

Response done (array) will be similar to:

  [
    {
      preview: '/tempdirectory/nikon_d850_01.jpg',
      source: '/directory/nikon_d850_01.nef'
    },
    {
      preview: '/tempdirectory/sony_a7r_iii_01.jpg',
      source: '/directory/sony_a7r_iii_01.arw'
    },
    {
      preview: '/tempdirectory/pentax_k_1_mark_ii_01.jpg',
      source: '/directory/pentax_k_1_mark_ii_01.dng'
    },
    {
      preview: '/tempdirectory/fujifilm_gfx_50s_01.jpg',
      source: '/directory/fujifilm_gfx_50s_01.raf'
    },
    {
      preview: '/tempdirectory/panasonic_s1r_01.jpg',
      source: '/directory/panasonic_s1r_01.rw2'
    }
  ]

As persist option was used only single exif process was used across all three calls. Last item terminates exif process as persist defaults to false.

Errors

All erros are resolved and fallow similar convention:

const extractd = require('extractd');

(async () => {

    const done = await extractd('/directory/dummyFile.nef');

})();

Response done (object) will be similar to:

{
  error: 'File not found',
  source: '/directory/dummyFile.nef'
}

Tests

To run all available tests

npm test

License

The MIT License (MIT). Please see license file for more information.

Keywords

FAQs

Package last updated on 08 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc