exifreader 4.16.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -13
- package/bin/build.js +38 -7
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/exif-reader.d.ts +12 -1
- package/package.json +2 -2
- package/src/constants.js +1 -0
- package/src/exif-reader.js +10 -0
- package/src/photoshop-tag-names.js +1062 -0
- package/src/photoshop-tags.js +67 -0
- package/src/tag-names-exif-ifd.js +1 -0
- package/src/utils.js +33 -0
- package/dist/exif-reader.js.gz +0 -0
package/exif-reader.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ type NumberArrayTag = TypedTag<number[]>
|
|
|
124
124
|
|
|
125
125
|
type StringArrayTag = TypedTag<string[]>
|
|
126
126
|
|
|
127
|
+
type StringTag = TypedTag<string>;
|
|
128
|
+
|
|
127
129
|
interface ValueTag {
|
|
128
130
|
description: string,
|
|
129
131
|
value: string
|
|
@@ -175,6 +177,7 @@ interface ExpandedTags {
|
|
|
175
177
|
riff?: RiffTags,
|
|
176
178
|
Thumbnail?: ThumbnailTags,
|
|
177
179
|
gps?: GpsTags
|
|
180
|
+
photoshop?: PhotoshopTags;
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
interface GpsTags {
|
|
@@ -216,6 +219,14 @@ interface MPFImageTags {
|
|
|
216
219
|
base64: string
|
|
217
220
|
}
|
|
218
221
|
|
|
222
|
+
interface PhotoshopTags {
|
|
223
|
+
// CaptionDigest: StringTag;
|
|
224
|
+
// PrintInformation: StringTag;
|
|
225
|
+
// PrintStyle: StringTag;
|
|
226
|
+
PathInformation: StringTag;
|
|
227
|
+
ClippingPathName: StringTag;
|
|
228
|
+
}
|
|
229
|
+
|
|
219
230
|
export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer): Tags;
|
|
220
231
|
export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded: true, includeUnknown?: boolean, length?: number}): ExpandedTags;
|
|
221
232
|
export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded?: false, includeUnknown?: boolean, length?: number}): Tags;
|
|
@@ -473,7 +484,7 @@ interface IccTags {
|
|
|
473
484
|
[name: string]: ValueTag;
|
|
474
485
|
}
|
|
475
486
|
|
|
476
|
-
export type Tags = XmpTags & IccTags & PngTags & RiffTags & {
|
|
487
|
+
export type Tags = XmpTags & IccTags & PngTags & RiffTags & PhotoshopTags & {
|
|
477
488
|
'Thumbnail'?: ThumbnailTags;
|
|
478
489
|
'Images'?: MPFImageTags[],
|
|
479
490
|
} & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exifreader",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "Library that parses Exif metadata in images.",
|
|
5
5
|
"author": "Mattias Wallander <mattias@wallander.eu>",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"test:e2e": "cypress run",
|
|
63
63
|
"test:types": "tsc --noEmit --project test/types",
|
|
64
64
|
"test:all": "npm-run-all lint test:types coverage test:e2e test:build test:build:custom",
|
|
65
|
-
"pre-commit": "npm-run-all lint test test:build",
|
|
65
|
+
"pre-commit": "npm-run-all lint test:types test test:build",
|
|
66
66
|
"postinstall": "node bin/build.js --only-with-config",
|
|
67
67
|
"prepare": "husky install"
|
|
68
68
|
},
|
package/src/constants.js
CHANGED
package/src/exif-reader.js
CHANGED
|
@@ -20,6 +20,7 @@ import FileTags from './file-tags.js';
|
|
|
20
20
|
import JfifTags from './jfif-tags.js';
|
|
21
21
|
import IptcTags from './iptc-tags.js';
|
|
22
22
|
import XmpTags from './xmp-tags.js';
|
|
23
|
+
import PhotoshopTags from './photoshop-tags.js';
|
|
23
24
|
import IccTags from './icc-tags.js';
|
|
24
25
|
import PngFileTags from './png-file-tags.js';
|
|
25
26
|
import PngTextTags from './png-text-tags.js';
|
|
@@ -266,6 +267,15 @@ export function loadView(dataView, {expanded = false, includeUnknown = false} =
|
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
|
|
270
|
+
if (Constants.USE_PHOTOSHOP && readTags['ImageSourceData']) {
|
|
271
|
+
const readPhotoshopTags = PhotoshopTags.read(readTags['PhotoshopSettings'].value, includeUnknown);
|
|
272
|
+
if (expanded) {
|
|
273
|
+
tags.photoshop = readPhotoshopTags;
|
|
274
|
+
} else {
|
|
275
|
+
tags = objectAssign({}, tags, readPhotoshopTags);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
269
279
|
if (Constants.USE_TIFF && Constants.USE_ICC && readTags['ICC_Profile'] && !hasIccData(iccChunks)) {
|
|
270
280
|
const readIccTags = IccTags.read(
|
|
271
281
|
readTags['ICC_Profile'].value,
|