exifreader 4.40.4 → 4.41.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 +34 -15
- package/babel.config.json +3 -8
- package/bin/build.js +75 -45
- package/bin/cli.js +165 -0
- package/bin/findDependentConfig.js +49 -8
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/package.json +11 -8
- package/src/exif-reader.js +0 -1
- package/src/icc-tags.js +4 -0
- package/src/loadview-pipeline.js +17 -13
- package/src/photoshop-tag-names.js +0 -927
- package/webpack.config.js +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exifreader",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.41.0",
|
|
4
4
|
"description": "Library that parses Exif metadata in images.",
|
|
5
5
|
"author": "Mattias Wallander <mattias@wallander.eu>",
|
|
6
6
|
"repository": {
|
|
@@ -21,19 +21,22 @@
|
|
|
21
21
|
"webpack.config.js"
|
|
22
22
|
],
|
|
23
23
|
"types": "./exif-reader.d.ts",
|
|
24
|
+
"bin": {
|
|
25
|
+
"exifreader": "bin/cli.js"
|
|
26
|
+
},
|
|
24
27
|
"optionalDependencies": {
|
|
25
28
|
"@xmldom/xmldom": "^0.9.10"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
|
-
"@babel/core": "^7.
|
|
29
|
-
"@babel/preset-env": "^7.29.
|
|
30
|
-
"@babel/register": "^7.29.
|
|
31
|
+
"@babel/core": "^7.29.7",
|
|
32
|
+
"@babel/preset-env": "^7.29.7",
|
|
33
|
+
"@babel/register": "^7.29.7",
|
|
31
34
|
"@types/node": "^25.9.1",
|
|
32
35
|
"babel-loader": "^10.0.0",
|
|
33
36
|
"babel-plugin-rewire": "^1.2.0",
|
|
34
37
|
"chai": "^4.3.10",
|
|
35
38
|
"cross-env": "^10.0.0",
|
|
36
|
-
"cypress": "^15.
|
|
39
|
+
"cypress": "^15.16.0",
|
|
37
40
|
"eslint": "^8.52.0",
|
|
38
41
|
"eslint-plugin-cypress": "^3.0.2",
|
|
39
42
|
"husky": "^9.0.11",
|
|
@@ -43,10 +46,10 @@
|
|
|
43
46
|
"nyc": "^18.0.0",
|
|
44
47
|
"rimraf": "^5.0.5",
|
|
45
48
|
"string-replace-loader": "^3.1.0",
|
|
46
|
-
"terser-webpack-plugin": "^5.6.
|
|
49
|
+
"terser-webpack-plugin": "^5.6.1",
|
|
47
50
|
"typescript": "^6.0.3",
|
|
48
|
-
"webpack": "5.107.
|
|
49
|
-
"webpack-cli": "^7.0.
|
|
51
|
+
"webpack": "5.107.2",
|
|
52
|
+
"webpack-cli": "^7.0.3",
|
|
50
53
|
"webpack-dev-server": "^5.2.4"
|
|
51
54
|
},
|
|
52
55
|
"scripts": {
|
package/src/exif-reader.js
CHANGED
package/src/icc-tags.js
CHANGED
|
@@ -89,6 +89,7 @@ function doesNotHaveTagData(dataView, tagHeaderOffset) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export function parseTags(dataView) {
|
|
92
|
+
const MAX_MLUC_RECORDS = 1000;
|
|
92
93
|
const buffer = dataView.buffer;
|
|
93
94
|
|
|
94
95
|
const length = dataView.getUint32();
|
|
@@ -164,6 +165,9 @@ export function parseTags(dataView) {
|
|
|
164
165
|
if (recordSize < MIN_MULTI_LOCALIZED_UNICODE_RECORD_SIZE) {
|
|
165
166
|
return tags;
|
|
166
167
|
}
|
|
168
|
+
if (numRecords > MAX_MLUC_RECORDS) {
|
|
169
|
+
return tags;
|
|
170
|
+
}
|
|
167
171
|
const recordsSize = numRecords * recordSize;
|
|
168
172
|
const availableRecordsSize = dataView.byteLength - tagOffset
|
|
169
173
|
- MULTI_LOCALIZED_UNICODE_RECORDS_OFFSET;
|
package/src/loadview-pipeline.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
|
|
5
|
+
import Constants from './constants.js';
|
|
6
|
+
|
|
5
7
|
export function buildTagsFromMergeSteps({
|
|
6
8
|
mergeSteps,
|
|
7
9
|
deferredResults,
|
|
@@ -37,7 +39,8 @@ export function buildTagsFromMergeSteps({
|
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
if (
|
|
40
|
-
|
|
42
|
+
Constants.USE_PNG
|
|
43
|
+
&& expanded
|
|
41
44
|
&& pngTextIsAsync
|
|
42
45
|
&& tagFilter.shouldReturnGroup('png')
|
|
43
46
|
&& tags.png
|
|
@@ -46,7 +49,8 @@ export function buildTagsFromMergeSteps({
|
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
if (
|
|
49
|
-
|
|
52
|
+
Constants.USE_PNG
|
|
53
|
+
&& expanded
|
|
50
54
|
&& tagFilter.shouldReturnGroup('png')
|
|
51
55
|
&& deps.hasPngTextData(pngTextChunks)
|
|
52
56
|
&& tags.png
|
|
@@ -86,7 +90,7 @@ export function applyMergeStep({
|
|
|
86
90
|
return mergeMergeGroup(tags, step.groupKey, returnedTags, expanded, deps);
|
|
87
91
|
}
|
|
88
92
|
|
|
89
|
-
if (step.type === 'mergeXmpGroupAssign') {
|
|
93
|
+
if (Constants.USE_XMP && step.type === 'mergeXmpGroupAssign') {
|
|
90
94
|
const returnedTags =
|
|
91
95
|
deps.filterTagsForReturn('xmp', step.parsedTags, tagFilter);
|
|
92
96
|
|
|
@@ -102,7 +106,7 @@ export function applyMergeStep({
|
|
|
102
106
|
return deps.objectAssign({}, tags, returnedTagsForFlat);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
if (step.type === 'mergeIccDeferred') {
|
|
109
|
+
if (Constants.USE_ICC && step.type === 'mergeIccDeferred') {
|
|
106
110
|
const resolvedReadTags = deferredResults[step.deferredKey];
|
|
107
111
|
const parsedIccTags =
|
|
108
112
|
deps.filterTagsForParse('icc', resolvedReadTags, tagFilter);
|
|
@@ -118,7 +122,7 @@ export function applyMergeStep({
|
|
|
118
122
|
return mergeAssignGroup(tags, 'icc', returnedIccTags, expanded, deps);
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
if (step.type === 'mergeBrobExifDeferred') {
|
|
125
|
+
if (Constants.USE_JXL && step.type === 'mergeBrobExifDeferred') {
|
|
122
126
|
const resolvedReadTags = deferredResults[step.deferredKey];
|
|
123
127
|
if (!resolvedReadTags || Object.keys(resolvedReadTags).length === 0) {
|
|
124
128
|
return tags;
|
|
@@ -137,7 +141,7 @@ export function applyMergeStep({
|
|
|
137
141
|
return mergeAssignGroup(tags, 'exif', returnedTags, expanded, deps);
|
|
138
142
|
}
|
|
139
143
|
|
|
140
|
-
if (step.type === 'mergeBrobXmpDeferred') {
|
|
144
|
+
if (Constants.USE_JXL && step.type === 'mergeBrobXmpDeferred') {
|
|
141
145
|
const resolvedReadTags = deferredResults[step.deferredKey];
|
|
142
146
|
if (!resolvedReadTags || Object.keys(resolvedReadTags).length === 0) {
|
|
143
147
|
return tags;
|
|
@@ -164,7 +168,7 @@ export function applyMergeStep({
|
|
|
164
168
|
return deps.objectAssign({}, tags, returnedTagsForFlat);
|
|
165
169
|
}
|
|
166
170
|
|
|
167
|
-
if (step.type === 'mergePngFile') {
|
|
171
|
+
if (Constants.USE_PNG && step.type === 'mergePngFile') {
|
|
168
172
|
const returnedPngFileTags =
|
|
169
173
|
deps.filterTagsForReturn('png', step.parsedTags, tagFilter);
|
|
170
174
|
|
|
@@ -186,7 +190,7 @@ export function applyMergeStep({
|
|
|
186
190
|
return deps.objectAssign({}, tags, returnedPngFileTags);
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
if (step.type === 'mergePngChunk') {
|
|
193
|
+
if (Constants.USE_PNG && step.type === 'mergePngChunk') {
|
|
190
194
|
const returnedPngChunkTags =
|
|
191
195
|
deps.filterTagsForReturn('png', step.parsedTags, tagFilter);
|
|
192
196
|
|
|
@@ -207,7 +211,7 @@ export function applyMergeStep({
|
|
|
207
211
|
return deps.objectAssign({}, tags, returnedPngChunkTags);
|
|
208
212
|
}
|
|
209
213
|
|
|
210
|
-
if (step.type === 'processPngTextReadTags') {
|
|
214
|
+
if (Constants.USE_PNG && step.type === 'processPngTextReadTags') {
|
|
211
215
|
return addPngTextReadTagsToTagsAndGroups({
|
|
212
216
|
readTags: step.readTags,
|
|
213
217
|
parsedGroups,
|
|
@@ -218,7 +222,7 @@ export function applyMergeStep({
|
|
|
218
222
|
});
|
|
219
223
|
}
|
|
220
224
|
|
|
221
|
-
if (step.type === 'processPngTextReadTagsDeferredList') {
|
|
225
|
+
if (Constants.USE_PNG && step.type === 'processPngTextReadTagsDeferredList') {
|
|
222
226
|
const tagList = deferredResults[step.deferredKey] || [];
|
|
223
227
|
|
|
224
228
|
for (let i = 0; i < tagList.length; i++) {
|
|
@@ -304,9 +308,9 @@ export function applyMergeStep({
|
|
|
304
308
|
parsedGroups.thumbnail = parsedThumbnailIfdTags;
|
|
305
309
|
}
|
|
306
310
|
|
|
307
|
-
const thumbnail = (
|
|
308
|
-
&&
|
|
309
|
-
&&
|
|
311
|
+
const thumbnail = (Constants.USE_JPEG || Constants.USE_WEBP)
|
|
312
|
+
&& Constants.USE_EXIF
|
|
313
|
+
&& Constants.USE_THUMBNAIL
|
|
310
314
|
&& deps.Thumbnail.get(exifDataView || dataView, parsedThumbnailIfdTags, tiffHeaderOffset);
|
|
311
315
|
if (thumbnail) {
|
|
312
316
|
tags.Thumbnail = thumbnail;
|