exifreader 4.6.0 → 4.7.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/bin/build.js +2 -2
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/package.json +6 -6
- package/src/exif-reader.js +4 -4
- package/src/utils.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exifreader",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "Library that parses Exif metadata in images.",
|
|
5
5
|
"author": "Mattias Wallander <mattias@wallander.eu>",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"types": "./exif-reader.d.ts",
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@xmldom/xmldom": "^0.7.
|
|
25
|
+
"@xmldom/xmldom": "^0.7.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.15.8",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"string-replace-loader": "^3.0.3",
|
|
46
46
|
"terser-webpack-plugin": "^5.2.4",
|
|
47
|
-
"webpack": "^5.
|
|
48
|
-
"webpack-cli": "^4.
|
|
49
|
-
"webpack-dev-server": "^4.
|
|
47
|
+
"webpack": "^5.74.0",
|
|
48
|
+
"webpack-cli": "^4.10.0",
|
|
49
|
+
"webpack-dev-server": "^4.11.1"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "node bin/build.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"nyc": {
|
|
67
67
|
"check-coverage": true,
|
|
68
68
|
"statements": 95,
|
|
69
|
-
"branches":
|
|
69
|
+
"branches": 93,
|
|
70
70
|
"functions": 98,
|
|
71
71
|
"lines": 96,
|
|
72
72
|
"reporter": [
|
package/src/exif-reader.js
CHANGED
|
@@ -47,11 +47,11 @@ function isFilePathOrURL(data) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function loadFile(filename) {
|
|
50
|
-
if (typeof fetch !== 'undefined') {
|
|
51
|
-
return browserFetchRemoteFile(filename);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
50
|
if (/^https?:\/\//.test(filename)) {
|
|
51
|
+
if (typeof fetch !== 'undefined') {
|
|
52
|
+
return browserFetchRemoteFile(filename);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
55
|
return nodeFetchRemoteFile(filename);
|
|
56
56
|
}
|
|
57
57
|
|
package/src/utils.js
CHANGED
|
@@ -58,6 +58,10 @@ export function deferInit(object, key, initializer) {
|
|
|
58
58
|
|
|
59
59
|
export function getBase64Image(image) {
|
|
60
60
|
if (typeof btoa !== 'undefined') {
|
|
61
|
+
if (typeof image === 'string') {
|
|
62
|
+
// This only happens during the build tests using Node 16+ (npm run test:build).
|
|
63
|
+
return btoa(image);
|
|
64
|
+
}
|
|
61
65
|
// IE11- does not implement reduce on the Uint8Array prototype.
|
|
62
66
|
return btoa(Array.prototype.reduce.call(new Uint8Array(image), (data, byte) => data + String.fromCharCode(byte), ''));
|
|
63
67
|
}
|