exifreader 4.36.2 → 4.37.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 +4 -0
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/exif-reader.d.ts +8 -0
- package/package.json +3 -3
- package/src/canon-tags.js +24 -1
- package/src/tag-names-canon-ifd.js +5 -0
package/exif-reader.d.ts
CHANGED
|
@@ -289,6 +289,14 @@ interface CanonTags {
|
|
|
289
289
|
value: number;
|
|
290
290
|
description: 'None' | 'Rotate 90 CW' | 'Rotate 180' | 'Rotate 270 CW' | 'Unknown';
|
|
291
291
|
};
|
|
292
|
+
LensType?: {
|
|
293
|
+
value: number;
|
|
294
|
+
description: string;
|
|
295
|
+
};
|
|
296
|
+
LensModel?: {
|
|
297
|
+
value: string[];
|
|
298
|
+
description: string;
|
|
299
|
+
};
|
|
292
300
|
}
|
|
293
301
|
|
|
294
302
|
interface PentaxTags {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exifreader",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.0",
|
|
4
4
|
"description": "Library that parses Exif metadata in images.",
|
|
5
5
|
"author": "Mattias Wallander <mattias@wallander.eu>",
|
|
6
6
|
"repository": {
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"linkedom": "^0.18.9",
|
|
41
41
|
"mocha": "^11.0.1",
|
|
42
42
|
"npm-run-all": "^4.1.5",
|
|
43
|
-
"nyc": "^
|
|
43
|
+
"nyc": "^18.0.0",
|
|
44
44
|
"rimraf": "^5.0.5",
|
|
45
45
|
"string-replace-loader": "^3.1.0",
|
|
46
46
|
"terser-webpack-plugin": "^5.3.10",
|
|
47
47
|
"typescript": "^5.6.2",
|
|
48
|
-
"webpack": "5.105.
|
|
48
|
+
"webpack": "5.105.4",
|
|
49
49
|
"webpack-cli": "^5.1.4",
|
|
50
50
|
"webpack-dev-server": "^5.0.4"
|
|
51
51
|
},
|
package/src/canon-tags.js
CHANGED
|
@@ -14,10 +14,12 @@ import {readIfd} from './tags-helpers.js';
|
|
|
14
14
|
import {IFD_TYPE_CANON} from './tag-names.js';
|
|
15
15
|
|
|
16
16
|
const SHOT_INFO_AUTO_ROTATE = 27; // First position is size.
|
|
17
|
+
const CAMERA_SETTINGS_LENS_TYPE = 22; // First position is size.
|
|
17
18
|
|
|
18
19
|
export default {
|
|
19
20
|
read,
|
|
20
|
-
SHOT_INFO_AUTO_ROTATE
|
|
21
|
+
SHOT_INFO_AUTO_ROTATE,
|
|
22
|
+
CAMERA_SETTINGS_LENS_TYPE
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
function read(
|
|
@@ -45,6 +47,10 @@ function read(
|
|
|
45
47
|
tags = objectAssign({}, tags, parseShotInfo(tags['ShotInfo'].value));
|
|
46
48
|
delete tags['ShotInfo'];
|
|
47
49
|
}
|
|
50
|
+
if (tags['CameraSettings']) {
|
|
51
|
+
tags = objectAssign({}, tags, parseCameraSettings(tags['CameraSettings'].value));
|
|
52
|
+
delete tags['CameraSettings'];
|
|
53
|
+
}
|
|
48
54
|
|
|
49
55
|
return tags;
|
|
50
56
|
}
|
|
@@ -62,6 +68,23 @@ function parseShotInfo(shotInfoData) {
|
|
|
62
68
|
return tags;
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
function parseCameraSettings(cameraSettingsData) {
|
|
72
|
+
const tags = {};
|
|
73
|
+
if (!Array.isArray(cameraSettingsData)) {
|
|
74
|
+
return tags;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const lensType = cameraSettingsData[CAMERA_SETTINGS_LENS_TYPE];
|
|
78
|
+
if (Number.isFinite(lensType)) {
|
|
79
|
+
tags['LensType'] = {
|
|
80
|
+
value: lensType,
|
|
81
|
+
description: `${lensType}`
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return tags;
|
|
86
|
+
}
|
|
87
|
+
|
|
65
88
|
function getAutoRotateDescription(autoRotate) {
|
|
66
89
|
if (autoRotate === 0) {
|
|
67
90
|
return 'None';
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
+
0x0001: {
|
|
7
|
+
'name': 'CameraSettings',
|
|
8
|
+
'description': (value) => value
|
|
9
|
+
},
|
|
6
10
|
0x0004: {
|
|
7
11
|
'name': 'ShotInfo',
|
|
8
12
|
'description': (value) => value
|
|
9
13
|
},
|
|
14
|
+
0x0095: 'LensModel',
|
|
10
15
|
};
|