exifreader 4.17.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/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.17.0",
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
@@ -11,6 +11,7 @@ export default {
11
11
  USE_XMP: true,
12
12
  USE_ICC: true,
13
13
  USE_MPF: true,
14
+ USE_PHOTOSHOP: true,
14
15
  USE_THUMBNAIL: true,
15
16
  USE_TIFF: true,
16
17
  USE_JPEG: true,
@@ -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,