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 - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

67

extractd.js

@@ -89,4 +89,33 @@ const fs = require('fs');

async function generate(list, options = {}, exiftool = null, items = [], main = {}) {
function result(source, list) {
const item = list.shift();
if (!item) {
return result(source, list);
}
if (item instanceof Error) {
let error = item;
if (error.message && error.message.includes(' - ')) {
error = error.message.split(' - ').shift();
}
if (error.message && error.message.includes('\n')) {
error = error.message.split('\n').pop();
}
return {
error,
source
};
}
return item;
}
async function generate(list, options = {}, exiftool = null, items = [], create = {}, main = null) {
if (typeof list === 'string') {

@@ -139,32 +168,26 @@ list = [list];

await (master.exiftool || exiftool)[`extract${listPreviews.replace('Image', '')}`](source, preview);
create = await outcome((master.exiftool || exiftool)[`extract${listPreviews.replace('Image', '')}`](source, preview));
if (meta.result.Orientation && typeof meta.result.Orientation === 'number') {
if (create.success) {
await (master.exiftool || exiftool).write(preview, {
Orientation: orientations[meta.result.Orientation - 1]
}, ['-overwrite_original_in_place']);
if (meta.result.Orientation && typeof meta.result.Orientation === 'number') {
await (master.exiftool || exiftool).write(preview, {
Orientation: orientations[meta.result.Orientation - 1]
}, ['-overwrite_original_in_place']);
}
main = {
preview: !options.stream ? preview : streamWipe(preview),
source
};
}
main = {
preview: !options.stream ? preview : streamWipe(preview),
source
};
} else {
main = {
error: 'No preview detected in the file',
source
};
}
} else {
main = {
error: (meta.error.message) ? meta.error.message.split(' - ').shift() : meta.error,
source
}
}
items.push(main);
items.push(result(source, [main, meta.error, create.error]));

@@ -171,0 +194,0 @@ if (list.length) {

{
"name": "extractd",
"version": "1.1.4",
"version": "1.1.5",
"description": "Extract previews from DSLR and mirrorless cameras' RAW files",

@@ -5,0 +5,0 @@ "main": "extractd.js",

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