exiftool-vendored
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -71,6 +71,6 @@ "use strict"; | ||
day // 1-31 | ||
) { | ||
) { | ||
this.year = year; | ||
this.month = month; | ||
this.day = day; // 1-31 | ||
this.day = day; | ||
} // tslint:disable-line | ||
@@ -77,0 +77,0 @@ toString() { |
@@ -30,3 +30,3 @@ import { Tags } from "./tags"; | ||
* | ||
* Note that these images are less than .1 megapixels in size. | ||
* Note that these images can be less than .1 megapixels in size. | ||
* | ||
@@ -41,3 +41,4 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
* | ||
* The size of these images varies widely, and is not present in most images. | ||
* The size of these images varies widely, and is present in dSLR images. | ||
* Canon, Fuji, Olympus, and Sony use this tag. | ||
* | ||
@@ -53,2 +54,3 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
* This size of these images varies widely, and is not present in all RAW images. | ||
* Nikon and Panasonic use this tag. | ||
* | ||
@@ -58,4 +60,12 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
*/ | ||
extractJpgFromRaw(imageFile: string, previewFile: string): Promise<void>; | ||
extractJpgFromRaw(imageFile: string, outputFile: string): Promise<void>; | ||
/** | ||
* Extract a given binary value from "tagname" tag associated to `path/to/image.jpg` | ||
* and write it to `dest` (which cannot exist and whose directory must already exist). | ||
* | ||
* @return a `Promise<void>`. An `Error` is raised if | ||
* the binary output not be written to `dest`. | ||
*/ | ||
extractBinaryTag(tagname: string, src: string, dest: string): Promise<void>; | ||
/** | ||
* Request graceful shut down of any running ExifTool child processes. | ||
@@ -72,3 +82,2 @@ * | ||
enqueueTask<T>(task: Task<T>): Task<T>; | ||
private extract(tagname, src, dest); | ||
private dequeueTask(); | ||
@@ -75,0 +84,0 @@ private procs(); |
"use strict"; | ||
const exiftool_process_1 = require("./exiftool_process"); | ||
const image_extraction_task_1 = require("./image_extraction_task"); | ||
const binary_extraction_task_1 = require("./binary_extraction_task"); | ||
const tags_task_1 = require("./tags_task"); | ||
@@ -43,3 +43,3 @@ const version_task_1 = require("./version_task"); | ||
* | ||
* Note that these images are less than .1 megapixels in size. | ||
* Note that these images can be less than .1 megapixels in size. | ||
* | ||
@@ -50,3 +50,3 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
extractThumbnail(imageFile, thumbnailFile) { | ||
return this.extract("ThumbnailImage", imageFile, thumbnailFile); | ||
return this.extractBinaryTag("ThumbnailImage", imageFile, thumbnailFile); | ||
} | ||
@@ -57,3 +57,4 @@ /** | ||
* | ||
* The size of these images varies widely, and is not present in most images. | ||
* The size of these images varies widely, and is present in dSLR images. | ||
* Canon, Fuji, Olympus, and Sony use this tag. | ||
* | ||
@@ -64,3 +65,3 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
extractPreview(imageFile, previewFile) { | ||
return this.extract("PreviewImage", imageFile, previewFile); | ||
return this.extractBinaryTag("PreviewImage", imageFile, previewFile); | ||
} | ||
@@ -72,2 +73,3 @@ /** | ||
* This size of these images varies widely, and is not present in all RAW images. | ||
* Nikon and Panasonic use this tag. | ||
* | ||
@@ -77,6 +79,16 @@ * @return a `Promise<void>`. An `Error` is raised if | ||
*/ | ||
extractJpgFromRaw(imageFile, previewFile) { | ||
return this.extract("JpgFromRaw", imageFile, previewFile); | ||
extractJpgFromRaw(imageFile, outputFile) { | ||
return this.extractBinaryTag("JpgFromRaw", imageFile, outputFile); | ||
} | ||
/** | ||
* Extract a given binary value from "tagname" tag associated to `path/to/image.jpg` | ||
* and write it to `dest` (which cannot exist and whose directory must already exist). | ||
* | ||
* @return a `Promise<void>`. An `Error` is raised if | ||
* the binary output not be written to `dest`. | ||
*/ | ||
extractBinaryTag(tagname, src, dest) { | ||
return this.enqueueTask(binary_extraction_task_1.BinaryExtractionTask.for(tagname, src, dest)).promise; | ||
} | ||
/** | ||
* Request graceful shut down of any running ExifTool child processes. | ||
@@ -100,5 +112,2 @@ * | ||
} | ||
extract(tagname, src, dest) { | ||
return this.enqueueTask(image_extraction_task_1.ImageExtractionTask.for(tagname, src, dest)).promise; | ||
} | ||
dequeueTask() { | ||
@@ -105,0 +114,0 @@ return this._tasks.shift(); |
{ | ||
"name": "exiftool-vendored", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Efficient, cross-platform access to ExifTool", | ||
@@ -24,2 +24,4 @@ "main": "./dist/exiftool.js", | ||
"files": [ | ||
"dist/binary_extraction_task.d.ts", | ||
"dist/binary_extraction_task.js", | ||
"dist/datetime.d.ts", | ||
@@ -29,14 +31,12 @@ "dist/datetime.js", | ||
"dist/deferred.js", | ||
"dist/exiftool_process.d.ts", | ||
"dist/exiftool_process.js", | ||
"dist/exiftool.d.ts", | ||
"dist/exiftool.js", | ||
"dist/exiftool_process.d.ts", | ||
"dist/exiftool_process.js", | ||
"dist/image_extraction_task.d.ts", | ||
"dist/image_extraction_task.js", | ||
"dist/parser.d.ts", | ||
"dist/parser.js", | ||
"dist/tags_task.d.ts", | ||
"dist/tags_task.js", | ||
"dist/tags.d.ts", | ||
"dist/tags.js", | ||
"dist/tags_task.d.ts", | ||
"dist/tags_task.js", | ||
"dist/task.d.ts", | ||
@@ -113,3 +113,3 @@ "dist/task.js", | ||
"tslint-eslint-rules": "^3.2.3", | ||
"typescript": "^2.1.5", | ||
"typescript": "=2.0.10", | ||
"typescript-formatter": "^4.0.1", | ||
@@ -116,0 +116,0 @@ "xmldom": "^0.1.27", |
@@ -35,3 +35,6 @@ # exiftool-vendored | ||
The vendored version of ExifTool relevant for your platform will be installed via [platform-dependent-modules](https://www.npmjs.com/package/platform-dependent-modules). You shouldn't include either the `exiftool-vendored.exe` or `exiftool-vendored.pl` as direct dependencies to your project. | ||
The vendored version of ExifTool relevant for your platform will | ||
be installed via [platform-dependent-modules](https://www.npmjs.com/package/platform-dependent-modules). | ||
You shouldn't include either the `exiftool-vendored.exe` or `exiftool-vendored.pl` as | ||
direct dependencies to your project. | ||
@@ -41,3 +44,3 @@ ## Usage | ||
```js | ||
import { exiftool, Tags } from "exiftool-vendored" | ||
import { exiftool } from "exiftool-vendored"; | ||
@@ -50,3 +53,3 @@ // Read all metadata tags in `path/to/image.jpg`. | ||
console.log(`Make: ${tags.Make}, Model: ${tags.Model}`) | ||
}) | ||
}); | ||
@@ -57,9 +60,14 @@ // Extract the low-resolution thumbnail in `path/to/image.jpg` | ||
// which contains an error or success status. | ||
exiftool.extractThumbnail("path/to/image.jpg", "path/to/thumbnail.jpg") | ||
exiftool.extractThumbnail("path/to/image.jpg", "path/to/thumbnail.jpg"); | ||
// Extract the "Preview" image (found in some images): | ||
exiftool.extractPreview("path/to/image.jpg", "path/to/preview.jpg") | ||
exiftool.extractPreview("path/to/image.jpg", "path/to/preview.jpg"); | ||
// Extract the "JpgFromRaw" image (found in some RAW images): | ||
exiftool.extractJpgFromRaw("path/to/image.cr2", "path/to/fromRaw.jpg") | ||
exiftool.extractJpgFromRaw("path/to/image.cr2", "path/to/fromRaw.jpg"); | ||
// Extract the binary value from "tagname" tag in `path/to/image.jpg` | ||
// and write it to `dest.bin` (which cannot exist already | ||
// and whose parent directory must already exist). | ||
extractBinaryTag("tagname", "path/to/file.exf", "path/to/dest.bin"); | ||
``` | ||
@@ -154,2 +162,8 @@ | ||
### v2.4.0 | ||
* ✨ `extractBinaryTag` exposed because there are a **lot** of binary tags | ||
(and they aren't all embedded images) | ||
* 🐞 `JpgFromRaw` was missing in `Tag` (no raw images were in the example corpus!) | ||
### v2.3.0 | ||
@@ -156,0 +170,0 @@ |
Sorry, the diff of this file is too big to display
127397
3427
239