exifreader 4.7.0 → 4.8.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/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/exif-reader.d.ts +4 -0
- package/package.json +1 -1
- package/src/image-header-jpeg.js +11 -0
package/exif-reader.d.ts
CHANGED
|
@@ -296,6 +296,10 @@ interface Tags {
|
|
|
296
296
|
'ImageUniqueID'?: StringArrayTag,
|
|
297
297
|
'LensMake'?: StringArrayTag,
|
|
298
298
|
'LensModel'?: StringArrayTag,
|
|
299
|
+
'OffsetTime'?: StringArrayTag,
|
|
300
|
+
'OffsetTimeDigitized'?: StringArrayTag,
|
|
301
|
+
'OffsetTimeOriginal'?: StringArrayTag,
|
|
302
|
+
'GPSHPositioningError'?: NumberArrayTag,
|
|
299
303
|
|
|
300
304
|
// GPS tags
|
|
301
305
|
'GPSVersionID'?: NumberTag,
|
package/package.json
CHANGED
package/src/image-header-jpeg.js
CHANGED
|
@@ -43,6 +43,10 @@ const APP13_MARKER = 0xffed;
|
|
|
43
43
|
const APP15_MARKER = 0xffef;
|
|
44
44
|
const COMMENT_MARKER = 0xfffe;
|
|
45
45
|
|
|
46
|
+
// Any number of fill bytes can be placed before an app marker. It's actually the first 0xff that is the
|
|
47
|
+
// fill byte and the next 0xff is either another fill byte or the first half of the next app marker.
|
|
48
|
+
const FILL_BYTE = 0xffff;
|
|
49
|
+
|
|
46
50
|
const APP0_JFIF_IDENTIFIER = 'JFIF';
|
|
47
51
|
const APP1_EXIF_IDENTIFIER = 'Exif';
|
|
48
52
|
const APP1_XMP_IDENTIFIER = 'http://ns.adobe.com/xap/1.0/\x00';
|
|
@@ -107,6 +111,9 @@ function findJpegOffsets(dataView) {
|
|
|
107
111
|
mpfDataOffset = appMarkerPosition + MPF_DATA_OFFSET;
|
|
108
112
|
} else if (isAppMarker(dataView, appMarkerPosition)) {
|
|
109
113
|
fieldLength = dataView.getUint16(appMarkerPosition + APP_MARKER_SIZE);
|
|
114
|
+
} else if (isFillByte(dataView, appMarkerPosition)) {
|
|
115
|
+
appMarkerPosition++;
|
|
116
|
+
continue;
|
|
110
117
|
} else {
|
|
111
118
|
break;
|
|
112
119
|
}
|
|
@@ -216,3 +223,7 @@ function isAppMarker(dataView, appMarkerPosition) {
|
|
|
216
223
|
|| (appMarker === DRI_MARKER)
|
|
217
224
|
|| (appMarker === SOS_MARKER);
|
|
218
225
|
}
|
|
226
|
+
|
|
227
|
+
function isFillByte(dataView, appMarkerPosition) {
|
|
228
|
+
return dataView.getUint16(appMarkerPosition) === FILL_BYTE;
|
|
229
|
+
}
|