exifreader 4.41.1 → 4.41.3
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/package.json +1 -1
- package/src/exif-reader.js +32 -123
- package/src/file-loaders.js +5 -17
- package/src/gif-file-tags.js +20 -92
- package/src/icc-tag-names.js +1 -1
- package/src/icc-tags.js +1 -5
- package/src/image-header-avif.js +4 -11
- package/src/image-header-gif.js +2 -4
- package/src/image-header-heic.js +4 -13
- package/src/image-header-iso-bmff-iloc.js +7 -2
- package/src/image-header-iso-bmff.js +31 -34
- package/src/image-header-jpeg.js +25 -39
- package/src/image-header-jxl.js +5 -12
- package/src/image-header-png.js +2 -8
- package/src/image-header-webp.js +2 -8
- package/src/load-auto.js +2 -4
- package/src/loadview-pipeline.js +15 -19
- package/src/package.json +1 -1
- package/src/png-file-tags.js +29 -114
- package/src/tag-names-utils.js +3 -3
- package/src/tags.js +26 -65
- package/src/utils.js +12 -0
- package/src/xml.js +2 -2
package/src/utils.js
CHANGED
|
@@ -61,6 +61,18 @@ export function getCharacterArray(string) {
|
|
|
61
61
|
return string.split('').map((character) => character.charCodeAt(0));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
export function pushMetadataBlock(metadataBlocks, type, start, end) {
|
|
65
|
+
if (metadataBlocks && type) {
|
|
66
|
+
metadataBlocks.push({type, start, end});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function assertPromiseSupport() {
|
|
71
|
+
if (typeof Promise === 'undefined') {
|
|
72
|
+
throw new Error('Promise is required when async mode is enabled.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
64
76
|
export function objectAssign() {
|
|
65
77
|
for (let i = 1; i < arguments.length; i++) {
|
|
66
78
|
for (const property in arguments[i]) {
|
package/src/xml.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 {getStringFromDataView} from './utils.js';
|
|
5
|
+
import {getStringFromDataView, pushMetadataBlock} from './utils.js';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
isXMLFile,
|
|
@@ -41,8 +41,8 @@ function isXMLFile(dataView) {
|
|
|
41
41
|
function findOffsets(dataView, metadataBlocks) {
|
|
42
42
|
const xmpChunks = [];
|
|
43
43
|
xmpChunks.push({dataOffset: XML_MARKER_OFFSET, length: dataView.byteLength});
|
|
44
|
+
pushMetadataBlock(metadataBlocks, 'xmp', 0, dataView.byteLength);
|
|
44
45
|
if (metadataBlocks) {
|
|
45
|
-
metadataBlocks.push({type: 'xmp', start: 0, end: dataView.byteLength});
|
|
46
46
|
metadataBlocks.truncated = !hasXmpClosingMarker(dataView);
|
|
47
47
|
}
|
|
48
48
|
return {
|