exifreader 4.22.0 → 4.22.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exifreader",
3
- "version": "4.22.0",
3
+ "version": "4.22.1",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
@@ -136,6 +136,8 @@ function getVariableSizedValue(dataView, offset, size) {
136
136
  return dataView.getUint32(offset);
137
137
  }
138
138
  if (size === 8) {
139
+ // eslint-disable-next-line no-console
140
+ console.warn('This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed.');
139
141
  return get64BitValue(dataView, offset);
140
142
  }
141
143
  return 0;
@@ -207,7 +207,8 @@ function findMetaBox(dataView) {
207
207
  function findExifOffset(dataView, metaBox) {
208
208
  try {
209
209
  const exifItemId = findIinfExifItemId(metaBox).itemId;
210
- const exifOffset = findIlocItem(metaBox, exifItemId).extents[0].extentOffset;
210
+ const ilocItem = findIlocItem(metaBox, exifItemId);
211
+ const exifOffset = ilocItem.baseOffset + ilocItem.extents[0].extentOffset;
211
212
  return getTiffHeaderOffset(dataView, exifOffset);
212
213
  } catch (error) {
213
214
  return undefined;
@@ -232,11 +233,12 @@ function getTiffHeaderOffset(dataView, exifOffset) {
232
233
  function findXmpChunks(metaBox) {
233
234
  try {
234
235
  const xmpItemId = findIinfXmpItemId(metaBox).itemId;
235
- const ilocItem = findIlocItem(metaBox, xmpItemId).extents[0];
236
+ const ilocItem = findIlocItem(metaBox, xmpItemId);
237
+ const ilocItemExtent = findIlocItem(metaBox, xmpItemId).extents[0];
236
238
  return [
237
239
  {
238
- dataOffset: ilocItem.extentOffset,
239
- length: ilocItem.extentLength,
240
+ dataOffset: ilocItem.baseOffset + ilocItemExtent.extentOffset,
241
+ length: ilocItemExtent.extentLength,
240
242
  }
241
243
  ];
242
244
  } catch (error) {