exifreader 4.2.0 → 4.4.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
@@ -179,6 +179,9 @@ interface MPFImageTags {
179
179
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer): Tags & XmpTags & IccTags;
180
180
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded: true}): ExpandedTags;
181
181
  export function load(data: ArrayBuffer | SharedArrayBuffer | Buffer, options: {expanded?: false}): Tags & XmpTags & IccTags;
182
+ export function load(data: string | File): Promise<Tags & XmpTags & IccTags>;
183
+ export function load(data: string | File, options: {expanded: true}): Promise<ExpandedTags>;
184
+ export function load(data: string | File, options: {expanded?: false}): Promise<Tags & XmpTags & IccTags>;
182
185
  export function loadView(data: DataView): Tags & XmpTags & IccTags;
183
186
  export function loadView(data: DataView, options: {expanded: true}): ExpandedTags;
184
187
  export function loadView(data: DataView, options: {expanded?: false}): Tags & XmpTags & IccTags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exifreader",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
@@ -227,6 +227,7 @@ export function loadView(dataView, {expanded = false, includeUnknown = false} =
227
227
  if (expanded) {
228
228
  tags.xmp = readXmpTags;
229
229
  } else {
230
+ delete readXmpTags._raw;
230
231
  tags = objectAssign({}, tags, readXmpTags);
231
232
  }
232
233
  }
@@ -265,6 +266,7 @@ export function loadView(dataView, {expanded = false, includeUnknown = false} =
265
266
  if (expanded) {
266
267
  tags.xmp = readTags;
267
268
  } else {
269
+ delete readTags._raw;
268
270
  tags = objectAssign({}, tags, readTags);
269
271
  }
270
272
  }
package/src/xmp-tags.js CHANGED
@@ -50,7 +50,8 @@ function combineChunks(dataView, chunks) {
50
50
 
51
51
  function readTags(tags, chunkDataView) {
52
52
  try {
53
- const doc = getDocument(chunkDataView);
53
+ const {doc, raw} = getDocument(chunkDataView);
54
+ tags._raw = (tags._raw || '') + raw;
54
55
  const rdf = getRDF(doc);
55
56
 
56
57
  return objectAssign(tags, parseXMPObject(convertToObject(rdf, true)));
@@ -74,7 +75,10 @@ function getDocument(chunkDataView) {
74
75
  throw new Error(doc.documentElement.textContent);
75
76
  }
76
77
 
77
- return doc;
78
+ return {
79
+ doc,
80
+ raw: xmlString,
81
+ };
78
82
  }
79
83
 
80
84
  function trimXmlSource(xmlSource) {