exifreader 4.15.0 → 4.17.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 +10 -2
- package/bin/build.js +38 -7
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/package.json +1 -1
- package/src/exif-reader.js +5 -5
- package/dist/exif-reader.js.gz +0 -0
package/package.json
CHANGED
package/src/exif-reader.js
CHANGED
|
@@ -51,12 +51,12 @@ function isFilePathOrURL(data) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function loadFile(filename, options) {
|
|
54
|
-
if (
|
|
54
|
+
if (/^\w+:\/\//.test(filename)) {
|
|
55
55
|
if (typeof fetch !== 'undefined') {
|
|
56
|
-
return
|
|
56
|
+
return fetchRemoteFile(filename, options);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return nodeGetRemoteFile(filename, options);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (isDataUri(filename)) {
|
|
@@ -66,7 +66,7 @@ function loadFile(filename, options) {
|
|
|
66
66
|
return loadLocalFile(filename, options);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
function
|
|
69
|
+
function fetchRemoteFile(url, {length} = {}) {
|
|
70
70
|
const options = {method: 'GET'};
|
|
71
71
|
if (Number.isInteger(length) && length >= 0) {
|
|
72
72
|
options.headers = {
|
|
@@ -76,7 +76,7 @@ function browserFetchRemoteFile(url, {length} = {}) {
|
|
|
76
76
|
return fetch(url, options).then((response) => response.arrayBuffer());
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function
|
|
79
|
+
function nodeGetRemoteFile(url, {length} = {}) {
|
|
80
80
|
return new Promise((resolve, reject) => {
|
|
81
81
|
const options = {};
|
|
82
82
|
if (Number.isInteger(length) && length >= 0) {
|
package/dist/exif-reader.js.gz
DELETED
|
Binary file
|