create-opentray 0.22.0 → 0.24.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/assets/create-openspec-template-iOS-Dark-1024@1x.png +0 -0
- package/assets/create-openspec-template-iOS-Default-1024@1x.png +0 -0
- package/assets/inter-glyph.OFL.txt +93 -0
- package/assets/inter-glyph.ttf +0 -0
- package/dist/{bin-Dyfucd3C.mjs → bin-BQb2Bjcu.mjs} +449 -2787
- package/dist/bin-BQb2Bjcu.mjs.map +1 -0
- package/dist/bin.mjs +1 -1
- package/dist/{decode-ico-D3SL2BXi.mjs → decode-ico-BHd2POHf.mjs} +2 -2
- package/dist/{decode-ico-D3SL2BXi.mjs.map → decode-ico-BHd2POHf.mjs.map} +1 -1
- package/dist/index.d.mts +40 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{raster-BQ07mKLu.mjs → raster-DeMbA2zI.mjs} +15 -16
- package/dist/{raster-BQ07mKLu.mjs.map → raster-DeMbA2zI.mjs.map} +1 -1
- package/dist/shell/assets/browse.js +1 -1
- package/dist/shell/assets/index.css +1 -1
- package/dist/shell/assets/index.js +9 -9
- package/dist/shell/assets/index2.js +2 -0
- package/dist/shell/assets/input.js +1 -1
- package/dist/shell/assets/main.js +20 -19
- package/dist/shell/assets/ort.bundle.min.js +2763 -0
- package/dist/shell/assets/ort.bundle.min.mjs +2817 -0
- package/dist/shell/assets/ort.webgpu.bundle.min.js +2763 -0
- package/dist/shell/assets/ort.webgpu.bundle.min.mjs +2817 -0
- package/dist/shell/assets/terminal-pane.js +1 -1
- package/dist/shell/assets/terminal.js +1 -1
- package/dist/shell/browse.html +1 -1
- package/dist/shell/index.html +1 -1
- package/dist/shell/terminal.html +1 -1
- package/dist/webui/assets/browse.js +1 -1
- package/dist/webui/assets/index.css +1 -1
- package/dist/webui/assets/index.js +9 -9
- package/dist/webui/assets/index2.js +2 -0
- package/dist/webui/assets/input.js +1 -1
- package/dist/webui/assets/main.js +20 -19
- package/dist/webui/assets/ort.bundle.min.js +2763 -0
- package/dist/webui/assets/ort.bundle.min.mjs +2817 -0
- package/dist/webui/assets/ort.webgpu.bundle.min.js +2763 -0
- package/dist/webui/assets/ort.webgpu.bundle.min.mjs +2817 -0
- package/dist/webui/assets/terminal-pane.js +1 -1
- package/dist/webui/assets/terminal.js +1 -1
- package/dist/webui/browse.html +1 -1
- package/dist/webui/index.html +1 -1
- package/dist/webui/terminal.html +1 -1
- package/package.json +15 -6
- package/dist/avif-DCXcyYJR.mjs +0 -2
- package/dist/bin-Dyfucd3C.mjs.map +0 -1
- package/dist/decode-C4b5NXc_.mjs +0 -1236
- package/dist/decode-C4b5NXc_.mjs.map +0 -1
- package/dist/decode-Dsj9J0OD.mjs +0 -1214
- package/dist/decode-Dsj9J0OD.mjs.map +0 -1
- package/dist/decode-FysWS28R.mjs +0 -254
- package/dist/decode-FysWS28R.mjs.map +0 -1
- package/dist/decode-Xr7mARKr.mjs +0 -1262
- package/dist/decode-Xr7mARKr.mjs.map +0 -1
- package/dist/full.umd-oM1VUBRH.mjs +0 -3055
- package/dist/full.umd-oM1VUBRH.mjs.map +0 -1
- package/dist/jpeg-B4tsxG5f.mjs +0 -2
- package/dist/png-rD0XEazj.mjs +0 -35
- package/dist/png-rD0XEazj.mjs.map +0 -1
- package/dist/resize-B47sgoOb.mjs +0 -489
- package/dist/resize-B47sgoOb.mjs.map +0 -1
- package/dist/resvg-wasm-fcJTLpJs.mjs +0 -522
- package/dist/resvg-wasm-fcJTLpJs.mjs.map +0 -1
- package/dist/rolldown-runtime-JspESFgx.mjs +0 -35
- package/dist/webp-CcbaCrQ7.mjs +0 -2
|
@@ -1,3055 +0,0 @@
|
|
|
1
|
-
import { r as __require, t as __commonJSMin } from "./rolldown-runtime-JspESFgx.mjs";
|
|
2
|
-
//#region ../../node_modules/.pnpm/exifr@7.1.3/node_modules/exifr/dist/full.umd.js
|
|
3
|
-
var require_full_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
-
(function(e, t) {
|
|
5
|
-
"object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define("exifr", ["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).exifr = {});
|
|
6
|
-
})(exports, (function(e) {
|
|
7
|
-
"use strict";
|
|
8
|
-
var t = "undefined" != typeof self ? self : global;
|
|
9
|
-
const i = "undefined" != typeof navigator, n = i && "undefined" == typeof HTMLImageElement, s = !("undefined" == typeof global || "undefined" == typeof process || !process.versions || !process.versions.node), r = t.Buffer, a = t.BigInt, o = !!r, l = (e) => e;
|
|
10
|
-
function h(e, t = l) {
|
|
11
|
-
if (s) try {
|
|
12
|
-
return "function" == typeof __require ? Promise.resolve(t(__require(e))) : import(
|
|
13
|
-
/* webpackIgnore: true */
|
|
14
|
-
e
|
|
15
|
-
).then(t);
|
|
16
|
-
} catch (t) {
|
|
17
|
-
console.warn(`Couldn't load ${e}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
let u = t.fetch;
|
|
21
|
-
const c = (e) => u = e;
|
|
22
|
-
if (!t.fetch) {
|
|
23
|
-
const e = h("http", ((e) => e)), t = h("https", ((e) => e)), i = (n, { headers: s } = {}) => new Promise((async (r, a) => {
|
|
24
|
-
let { port: o, hostname: l, pathname: h, protocol: u, search: c } = new URL(n);
|
|
25
|
-
const f = {
|
|
26
|
-
method: "GET",
|
|
27
|
-
hostname: l,
|
|
28
|
-
path: encodeURI(h) + c,
|
|
29
|
-
headers: s
|
|
30
|
-
};
|
|
31
|
-
"" !== o && (f.port = Number(o));
|
|
32
|
-
const d = ("https:" === u ? await t : await e).request(f, ((e) => {
|
|
33
|
-
if (301 === e.statusCode || 302 === e.statusCode) {
|
|
34
|
-
let t = new URL(e.headers.location, n).toString();
|
|
35
|
-
return i(t, { headers: s }).then(r).catch(a);
|
|
36
|
-
}
|
|
37
|
-
r({
|
|
38
|
-
status: e.statusCode,
|
|
39
|
-
arrayBuffer: () => new Promise(((t) => {
|
|
40
|
-
let i = [];
|
|
41
|
-
e.on("data", ((e) => i.push(e))), e.on("end", (() => t(Buffer.concat(i))));
|
|
42
|
-
}))
|
|
43
|
-
});
|
|
44
|
-
}));
|
|
45
|
-
d.on("error", a), d.end();
|
|
46
|
-
}));
|
|
47
|
-
c(i);
|
|
48
|
-
}
|
|
49
|
-
function f(e, t, i) {
|
|
50
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
51
|
-
value: i,
|
|
52
|
-
enumerable: !0,
|
|
53
|
-
configurable: !0,
|
|
54
|
-
writable: !0
|
|
55
|
-
}) : e[t] = i, e;
|
|
56
|
-
}
|
|
57
|
-
const d = (e) => g(e) ? void 0 : e, p = (e) => void 0 !== e;
|
|
58
|
-
function g(e) {
|
|
59
|
-
return void 0 === e || (e instanceof Map ? 0 === e.size : 0 === Object.values(e).filter(p).length);
|
|
60
|
-
}
|
|
61
|
-
function m(e) {
|
|
62
|
-
let t = new Error(e);
|
|
63
|
-
throw delete t.stack, t;
|
|
64
|
-
}
|
|
65
|
-
function S(e) {
|
|
66
|
-
return "" === (e = function(e) {
|
|
67
|
-
for (; e.endsWith("\0");) e = e.slice(0, -1);
|
|
68
|
-
return e;
|
|
69
|
-
}(e).trim()) ? void 0 : e;
|
|
70
|
-
}
|
|
71
|
-
function C(e) {
|
|
72
|
-
let t = function(e) {
|
|
73
|
-
let t = 0;
|
|
74
|
-
return e.ifd0.enabled && (t += 1024), e.exif.enabled && (t += 2048), e.makerNote && (t += 2048), e.userComment && (t += 1024), e.gps.enabled && (t += 512), e.interop.enabled && (t += 100), e.ifd1.enabled && (t += 1024), t + 2048;
|
|
75
|
-
}(e);
|
|
76
|
-
return e.jfif.enabled && (t += 50), e.xmp.enabled && (t += 2e4), e.iptc.enabled && (t += 14e3), e.icc.enabled && (t += 6e3), t;
|
|
77
|
-
}
|
|
78
|
-
const y = (e) => String.fromCharCode.apply(null, e), b = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : void 0;
|
|
79
|
-
function P(e) {
|
|
80
|
-
return b ? b.decode(e) : o ? Buffer.from(e).toString("utf8") : decodeURIComponent(escape(y(e)));
|
|
81
|
-
}
|
|
82
|
-
class I {
|
|
83
|
-
static from(e, t) {
|
|
84
|
-
return e instanceof this && e.le === t ? e : new I(e, void 0, void 0, t);
|
|
85
|
-
}
|
|
86
|
-
constructor(e, t = 0, i, n) {
|
|
87
|
-
if ("boolean" == typeof n && (this.le = n), Array.isArray(e) && (e = new Uint8Array(e)), 0 === e) this.byteOffset = 0, this.byteLength = 0;
|
|
88
|
-
else if (e instanceof ArrayBuffer) {
|
|
89
|
-
void 0 === i && (i = e.byteLength - t);
|
|
90
|
-
let n = new DataView(e, t, i);
|
|
91
|
-
this._swapDataView(n);
|
|
92
|
-
} else if (e instanceof Uint8Array || e instanceof DataView || e instanceof I) {
|
|
93
|
-
void 0 === i && (i = e.byteLength - t), (t += e.byteOffset) + i > e.byteOffset + e.byteLength && m("Creating view outside of available memory in ArrayBuffer");
|
|
94
|
-
let n = new DataView(e.buffer, t, i);
|
|
95
|
-
this._swapDataView(n);
|
|
96
|
-
} else if ("number" == typeof e) {
|
|
97
|
-
let t = new DataView(new ArrayBuffer(e));
|
|
98
|
-
this._swapDataView(t);
|
|
99
|
-
} else m("Invalid input argument for BufferView: " + e);
|
|
100
|
-
}
|
|
101
|
-
_swapArrayBuffer(e) {
|
|
102
|
-
this._swapDataView(new DataView(e));
|
|
103
|
-
}
|
|
104
|
-
_swapBuffer(e) {
|
|
105
|
-
this._swapDataView(new DataView(e.buffer, e.byteOffset, e.byteLength));
|
|
106
|
-
}
|
|
107
|
-
_swapDataView(e) {
|
|
108
|
-
this.dataView = e, this.buffer = e.buffer, this.byteOffset = e.byteOffset, this.byteLength = e.byteLength;
|
|
109
|
-
}
|
|
110
|
-
_lengthToEnd(e) {
|
|
111
|
-
return this.byteLength - e;
|
|
112
|
-
}
|
|
113
|
-
set(e, t, i = I) {
|
|
114
|
-
return e instanceof DataView || e instanceof I ? e = new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e instanceof ArrayBuffer && (e = new Uint8Array(e)), e instanceof Uint8Array || m("BufferView.set(): Invalid data argument."), this.toUint8().set(e, t), new i(this, t, e.byteLength);
|
|
115
|
-
}
|
|
116
|
-
subarray(e, t) {
|
|
117
|
-
return t = t || this._lengthToEnd(e), new I(this, e, t);
|
|
118
|
-
}
|
|
119
|
-
toUint8() {
|
|
120
|
-
return new Uint8Array(this.buffer, this.byteOffset, this.byteLength);
|
|
121
|
-
}
|
|
122
|
-
getUint8Array(e, t) {
|
|
123
|
-
return new Uint8Array(this.buffer, this.byteOffset + e, t);
|
|
124
|
-
}
|
|
125
|
-
getString(e = 0, t = this.byteLength) {
|
|
126
|
-
return P(this.getUint8Array(e, t));
|
|
127
|
-
}
|
|
128
|
-
getLatin1String(e = 0, t = this.byteLength) {
|
|
129
|
-
let i = this.getUint8Array(e, t);
|
|
130
|
-
return y(i);
|
|
131
|
-
}
|
|
132
|
-
getUnicodeString(e = 0, t = this.byteLength) {
|
|
133
|
-
const i = [];
|
|
134
|
-
for (let n = 0; n < t && e + n < this.byteLength; n += 2) i.push(this.getUint16(e + n));
|
|
135
|
-
return y(i);
|
|
136
|
-
}
|
|
137
|
-
getInt8(e) {
|
|
138
|
-
return this.dataView.getInt8(e);
|
|
139
|
-
}
|
|
140
|
-
getUint8(e) {
|
|
141
|
-
return this.dataView.getUint8(e);
|
|
142
|
-
}
|
|
143
|
-
getInt16(e, t = this.le) {
|
|
144
|
-
return this.dataView.getInt16(e, t);
|
|
145
|
-
}
|
|
146
|
-
getInt32(e, t = this.le) {
|
|
147
|
-
return this.dataView.getInt32(e, t);
|
|
148
|
-
}
|
|
149
|
-
getUint16(e, t = this.le) {
|
|
150
|
-
return this.dataView.getUint16(e, t);
|
|
151
|
-
}
|
|
152
|
-
getUint32(e, t = this.le) {
|
|
153
|
-
return this.dataView.getUint32(e, t);
|
|
154
|
-
}
|
|
155
|
-
getFloat32(e, t = this.le) {
|
|
156
|
-
return this.dataView.getFloat32(e, t);
|
|
157
|
-
}
|
|
158
|
-
getFloat64(e, t = this.le) {
|
|
159
|
-
return this.dataView.getFloat64(e, t);
|
|
160
|
-
}
|
|
161
|
-
getFloat(e, t = this.le) {
|
|
162
|
-
return this.dataView.getFloat32(e, t);
|
|
163
|
-
}
|
|
164
|
-
getDouble(e, t = this.le) {
|
|
165
|
-
return this.dataView.getFloat64(e, t);
|
|
166
|
-
}
|
|
167
|
-
getUintBytes(e, t, i) {
|
|
168
|
-
switch (t) {
|
|
169
|
-
case 1: return this.getUint8(e, i);
|
|
170
|
-
case 2: return this.getUint16(e, i);
|
|
171
|
-
case 4: return this.getUint32(e, i);
|
|
172
|
-
case 8: return this.getUint64 && this.getUint64(e, i);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
getUint(e, t, i) {
|
|
176
|
-
switch (t) {
|
|
177
|
-
case 8: return this.getUint8(e, i);
|
|
178
|
-
case 16: return this.getUint16(e, i);
|
|
179
|
-
case 32: return this.getUint32(e, i);
|
|
180
|
-
case 64: return this.getUint64 && this.getUint64(e, i);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
toString(e) {
|
|
184
|
-
return this.dataView.toString(e, this.constructor.name);
|
|
185
|
-
}
|
|
186
|
-
ensureChunk() {}
|
|
187
|
-
}
|
|
188
|
-
function k(e, t) {
|
|
189
|
-
m(`${e} '${t}' was not loaded, try using full build of exifr.`);
|
|
190
|
-
}
|
|
191
|
-
class w extends Map {
|
|
192
|
-
constructor(e) {
|
|
193
|
-
super(), this.kind = e;
|
|
194
|
-
}
|
|
195
|
-
get(e, t) {
|
|
196
|
-
return this.has(e) || k(this.kind, e), t && (e in t || function(e, t) {
|
|
197
|
-
m(`Unknown ${e} '${t}'.`);
|
|
198
|
-
}(this.kind, e), t[e].enabled || k(this.kind, e)), super.get(e);
|
|
199
|
-
}
|
|
200
|
-
keyList() {
|
|
201
|
-
return Array.from(this.keys());
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
var T = new w("file parser"), A = new w("segment parser"), D = new w("file reader");
|
|
205
|
-
const O = "Invalid input argument";
|
|
206
|
-
function x(e, t) {
|
|
207
|
-
return "string" == typeof e ? v(e, t) : i && !n && e instanceof HTMLImageElement ? v(e.src, t) : e instanceof Uint8Array || e instanceof ArrayBuffer || e instanceof DataView ? new I(e) : i && e instanceof Blob ? M(e, t, "blob", U) : void m(O);
|
|
208
|
-
}
|
|
209
|
-
function v(e, t) {
|
|
210
|
-
return (n = e).startsWith("data:") || n.length > 1e4 ? R(e, t, "base64") : s && e.includes("://") ? M(e, t, "url", L) : s ? R(e, t, "fs") : i ? M(e, t, "url", L) : void m(O);
|
|
211
|
-
var n;
|
|
212
|
-
}
|
|
213
|
-
async function M(e, t, i, n) {
|
|
214
|
-
return D.has(i) ? R(e, t, i) : n ? async function(e, t) {
|
|
215
|
-
let i = await t(e);
|
|
216
|
-
return new I(i);
|
|
217
|
-
}(e, n) : void m(`Parser ${i} is not loaded`);
|
|
218
|
-
}
|
|
219
|
-
async function R(e, t, i) {
|
|
220
|
-
let n = new (D.get(i))(e, t);
|
|
221
|
-
return await n.read(), n;
|
|
222
|
-
}
|
|
223
|
-
const L = (e) => u(e).then(((e) => e.arrayBuffer())), U = (e) => new Promise(((t, i) => {
|
|
224
|
-
let n = new FileReader();
|
|
225
|
-
n.onloadend = () => t(n.result || /* @__PURE__ */ new ArrayBuffer()), n.onerror = i, n.readAsArrayBuffer(e);
|
|
226
|
-
}));
|
|
227
|
-
class F extends Map {
|
|
228
|
-
get tagKeys() {
|
|
229
|
-
return this.allKeys || (this.allKeys = Array.from(this.keys())), this.allKeys;
|
|
230
|
-
}
|
|
231
|
-
get tagValues() {
|
|
232
|
-
return this.allValues || (this.allValues = Array.from(this.values())), this.allValues;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function B(e, t, i) {
|
|
236
|
-
let n = new F();
|
|
237
|
-
for (let [e, t] of i) n.set(e, t);
|
|
238
|
-
if (Array.isArray(t)) for (let i of t) e.set(i, n);
|
|
239
|
-
else e.set(t, n);
|
|
240
|
-
return n;
|
|
241
|
-
}
|
|
242
|
-
function E(e, t, i) {
|
|
243
|
-
let n, s = e.get(t);
|
|
244
|
-
for (n of i) s.set(n[0], n[1]);
|
|
245
|
-
}
|
|
246
|
-
const N = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), z = 37500, H = 37510, j = 700, W = 33723, K = 34675, X = 34665, _ = 34853, Y = 40965, $ = [
|
|
247
|
-
"chunked",
|
|
248
|
-
"firstChunkSize",
|
|
249
|
-
"firstChunkSizeNode",
|
|
250
|
-
"firstChunkSizeBrowser",
|
|
251
|
-
"chunkSize",
|
|
252
|
-
"chunkLimit"
|
|
253
|
-
], J = [
|
|
254
|
-
"jfif",
|
|
255
|
-
"xmp",
|
|
256
|
-
"icc",
|
|
257
|
-
"iptc",
|
|
258
|
-
"ihdr"
|
|
259
|
-
], q = ["tiff", ...J], Q = [
|
|
260
|
-
"ifd0",
|
|
261
|
-
"ifd1",
|
|
262
|
-
"exif",
|
|
263
|
-
"gps",
|
|
264
|
-
"interop"
|
|
265
|
-
], Z = [...q, ...Q], ee = ["makerNote", "userComment"], te = [
|
|
266
|
-
"translateKeys",
|
|
267
|
-
"translateValues",
|
|
268
|
-
"reviveValues",
|
|
269
|
-
"multiSegment"
|
|
270
|
-
], ie = [
|
|
271
|
-
...te,
|
|
272
|
-
"sanitize",
|
|
273
|
-
"mergeOutput",
|
|
274
|
-
"silentErrors"
|
|
275
|
-
];
|
|
276
|
-
class ne {
|
|
277
|
-
get translate() {
|
|
278
|
-
return this.translateKeys || this.translateValues || this.reviveValues;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
class se extends ne {
|
|
282
|
-
get needed() {
|
|
283
|
-
return this.enabled || this.deps.size > 0;
|
|
284
|
-
}
|
|
285
|
-
constructor(e, t, i, n) {
|
|
286
|
-
if (super(), f(this, "enabled", !1), f(this, "skip", /* @__PURE__ */ new Set()), f(this, "pick", /* @__PURE__ */ new Set()), f(this, "deps", /* @__PURE__ */ new Set()), f(this, "translateKeys", !1), f(this, "translateValues", !1), f(this, "reviveValues", !1), this.key = e, this.enabled = t, this.parse = this.enabled, this.applyInheritables(n), this.canBeFiltered = Q.includes(e), this.canBeFiltered && (this.dict = N.get(e)), void 0 !== i) if (Array.isArray(i)) this.parse = this.enabled = !0, this.canBeFiltered && i.length > 0 && this.translateTagSet(i, this.pick);
|
|
287
|
-
else if ("object" == typeof i) {
|
|
288
|
-
if (this.enabled = !0, this.parse = !1 !== i.parse, this.canBeFiltered) {
|
|
289
|
-
let { pick: e, skip: t } = i;
|
|
290
|
-
e && e.length > 0 && this.translateTagSet(e, this.pick), t && t.length > 0 && this.translateTagSet(t, this.skip);
|
|
291
|
-
}
|
|
292
|
-
this.applyInheritables(i);
|
|
293
|
-
} else !0 === i || !1 === i ? this.parse = this.enabled = i : m(`Invalid options argument: ${i}`);
|
|
294
|
-
}
|
|
295
|
-
applyInheritables(e) {
|
|
296
|
-
let t, i;
|
|
297
|
-
for (t of te) i = e[t], void 0 !== i && (this[t] = i);
|
|
298
|
-
}
|
|
299
|
-
translateTagSet(e, t) {
|
|
300
|
-
if (this.dict) {
|
|
301
|
-
let i, n, { tagKeys: s, tagValues: r } = this.dict;
|
|
302
|
-
for (i of e) "string" == typeof i ? (n = r.indexOf(i), -1 === n && (n = s.indexOf(Number(i))), -1 !== n && t.add(Number(s[n]))) : t.add(i);
|
|
303
|
-
} else for (let i of e) t.add(i);
|
|
304
|
-
}
|
|
305
|
-
finalizeFilters() {
|
|
306
|
-
!this.enabled && this.deps.size > 0 ? (this.enabled = !0, ue(this.pick, this.deps)) : this.enabled && this.pick.size > 0 && ue(this.pick, this.deps);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
var re = {
|
|
310
|
-
jfif: !1,
|
|
311
|
-
tiff: !0,
|
|
312
|
-
xmp: !1,
|
|
313
|
-
icc: !1,
|
|
314
|
-
iptc: !1,
|
|
315
|
-
ifd0: !0,
|
|
316
|
-
ifd1: !1,
|
|
317
|
-
exif: !0,
|
|
318
|
-
gps: !0,
|
|
319
|
-
interop: !1,
|
|
320
|
-
ihdr: void 0,
|
|
321
|
-
makerNote: !1,
|
|
322
|
-
userComment: !1,
|
|
323
|
-
multiSegment: !1,
|
|
324
|
-
skip: [],
|
|
325
|
-
pick: [],
|
|
326
|
-
translateKeys: !0,
|
|
327
|
-
translateValues: !0,
|
|
328
|
-
reviveValues: !0,
|
|
329
|
-
sanitize: !0,
|
|
330
|
-
mergeOutput: !0,
|
|
331
|
-
silentErrors: !0,
|
|
332
|
-
chunked: !0,
|
|
333
|
-
firstChunkSize: void 0,
|
|
334
|
-
firstChunkSizeNode: 512,
|
|
335
|
-
firstChunkSizeBrowser: 65536,
|
|
336
|
-
chunkSize: 65536,
|
|
337
|
-
chunkLimit: 5
|
|
338
|
-
}, ae = /* @__PURE__ */ new Map();
|
|
339
|
-
class oe extends ne {
|
|
340
|
-
static useCached(e) {
|
|
341
|
-
let t = ae.get(e);
|
|
342
|
-
return void 0 !== t || (t = new this(e), ae.set(e, t)), t;
|
|
343
|
-
}
|
|
344
|
-
constructor(e) {
|
|
345
|
-
super(), !0 === e ? this.setupFromTrue() : void 0 === e ? this.setupFromUndefined() : Array.isArray(e) ? this.setupFromArray(e) : "object" == typeof e ? this.setupFromObject(e) : m(`Invalid options argument ${e}`), void 0 === this.firstChunkSize && (this.firstChunkSize = i ? this.firstChunkSizeBrowser : this.firstChunkSizeNode), this.mergeOutput && (this.ifd1.enabled = !1), this.filterNestedSegmentTags(), this.traverseTiffDependencyTree(), this.checkLoadedPlugins();
|
|
346
|
-
}
|
|
347
|
-
setupFromUndefined() {
|
|
348
|
-
let e;
|
|
349
|
-
for (e of $) this[e] = re[e];
|
|
350
|
-
for (e of ie) this[e] = re[e];
|
|
351
|
-
for (e of ee) this[e] = re[e];
|
|
352
|
-
for (e of Z) this[e] = new se(e, re[e], void 0, this);
|
|
353
|
-
}
|
|
354
|
-
setupFromTrue() {
|
|
355
|
-
let e;
|
|
356
|
-
for (e of $) this[e] = re[e];
|
|
357
|
-
for (e of ie) this[e] = re[e];
|
|
358
|
-
for (e of ee) this[e] = !0;
|
|
359
|
-
for (e of Z) this[e] = new se(e, !0, void 0, this);
|
|
360
|
-
}
|
|
361
|
-
setupFromArray(e) {
|
|
362
|
-
let t;
|
|
363
|
-
for (t of $) this[t] = re[t];
|
|
364
|
-
for (t of ie) this[t] = re[t];
|
|
365
|
-
for (t of ee) this[t] = re[t];
|
|
366
|
-
for (t of Z) this[t] = new se(t, !1, void 0, this);
|
|
367
|
-
this.setupGlobalFilters(e, void 0, Q);
|
|
368
|
-
}
|
|
369
|
-
setupFromObject(e) {
|
|
370
|
-
let t;
|
|
371
|
-
for (t of (Q.ifd0 = Q.ifd0 || Q.image, Q.ifd1 = Q.ifd1 || Q.thumbnail, Object.assign(this, e), $)) this[t] = he(e[t], re[t]);
|
|
372
|
-
for (t of ie) this[t] = he(e[t], re[t]);
|
|
373
|
-
for (t of ee) this[t] = he(e[t], re[t]);
|
|
374
|
-
for (t of q) this[t] = new se(t, re[t], e[t], this);
|
|
375
|
-
for (t of Q) this[t] = new se(t, re[t], e[t], this.tiff);
|
|
376
|
-
this.setupGlobalFilters(e.pick, e.skip, Q, Z), !0 === e.tiff ? this.batchEnableWithBool(Q, !0) : !1 === e.tiff ? this.batchEnableWithUserValue(Q, e) : Array.isArray(e.tiff) ? this.setupGlobalFilters(e.tiff, void 0, Q) : "object" == typeof e.tiff && this.setupGlobalFilters(e.tiff.pick, e.tiff.skip, Q);
|
|
377
|
-
}
|
|
378
|
-
batchEnableWithBool(e, t) {
|
|
379
|
-
for (let i of e) this[i].enabled = t;
|
|
380
|
-
}
|
|
381
|
-
batchEnableWithUserValue(e, t) {
|
|
382
|
-
for (let i of e) {
|
|
383
|
-
let e = t[i];
|
|
384
|
-
this[i].enabled = !1 !== e && void 0 !== e;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
setupGlobalFilters(e, t, i, n = i) {
|
|
388
|
-
if (e && e.length) {
|
|
389
|
-
for (let e of n) this[e].enabled = !1;
|
|
390
|
-
let t = le(e, i);
|
|
391
|
-
for (let [e, i] of t) ue(this[e].pick, i), this[e].enabled = !0;
|
|
392
|
-
} else if (t && t.length) {
|
|
393
|
-
let e = le(t, i);
|
|
394
|
-
for (let [t, i] of e) ue(this[t].skip, i);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
filterNestedSegmentTags() {
|
|
398
|
-
let { ifd0: e, exif: t, xmp: i, iptc: n, icc: s } = this;
|
|
399
|
-
this.makerNote ? t.deps.add(z) : t.skip.add(z), this.userComment ? t.deps.add(H) : t.skip.add(H), i.enabled || e.skip.add(j), n.enabled || e.skip.add(W), s.enabled || e.skip.add(K);
|
|
400
|
-
}
|
|
401
|
-
traverseTiffDependencyTree() {
|
|
402
|
-
let { ifd0: e, exif: t, gps: i, interop: n } = this;
|
|
403
|
-
n.needed && (t.deps.add(Y), e.deps.add(Y)), t.needed && e.deps.add(X), i.needed && e.deps.add(_), this.tiff.enabled = Q.some(((e) => !0 === this[e].enabled)) || this.makerNote || this.userComment;
|
|
404
|
-
for (let e of Q) this[e].finalizeFilters();
|
|
405
|
-
}
|
|
406
|
-
get onlyTiff() {
|
|
407
|
-
return !J.map(((e) => this[e].enabled)).some(((e) => !0 === e)) && this.tiff.enabled;
|
|
408
|
-
}
|
|
409
|
-
checkLoadedPlugins() {
|
|
410
|
-
for (let e of q) this[e].enabled && !A.has(e) && k("segment parser", e);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function le(e, t) {
|
|
414
|
-
let i, n, s, r, a = [];
|
|
415
|
-
for (s of t) {
|
|
416
|
-
for (r of (i = N.get(s), n = [], i)) (e.includes(r[0]) || e.includes(r[1])) && n.push(r[0]);
|
|
417
|
-
n.length && a.push([s, n]);
|
|
418
|
-
}
|
|
419
|
-
return a;
|
|
420
|
-
}
|
|
421
|
-
function he(e, t) {
|
|
422
|
-
return void 0 !== e ? e : void 0 !== t ? t : void 0;
|
|
423
|
-
}
|
|
424
|
-
function ue(e, t) {
|
|
425
|
-
for (let i of t) e.add(i);
|
|
426
|
-
}
|
|
427
|
-
f(oe, "default", re);
|
|
428
|
-
class ce {
|
|
429
|
-
constructor(e) {
|
|
430
|
-
f(this, "parsers", {}), f(this, "output", {}), f(this, "errors", []), f(this, "pushToErrors", ((e) => this.errors.push(e))), this.options = oe.useCached(e);
|
|
431
|
-
}
|
|
432
|
-
async read(e) {
|
|
433
|
-
this.file = await x(e, this.options);
|
|
434
|
-
}
|
|
435
|
-
setup() {
|
|
436
|
-
if (this.fileParser) return;
|
|
437
|
-
let { file: e } = this, t = e.getUint16(0);
|
|
438
|
-
for (let [i, n] of T) if (n.canHandle(e, t)) return this.fileParser = new n(this.options, this.file, this.parsers), e[i] = !0;
|
|
439
|
-
this.file.close && this.file.close(), m("Unknown file format");
|
|
440
|
-
}
|
|
441
|
-
async parse() {
|
|
442
|
-
let { output: e, errors: t } = this;
|
|
443
|
-
return this.setup(), this.options.silentErrors ? (await this.executeParsers().catch(this.pushToErrors), t.push(...this.fileParser.errors)) : await this.executeParsers(), this.file.close && this.file.close(), this.options.silentErrors && t.length > 0 && (e.errors = t), d(e);
|
|
444
|
-
}
|
|
445
|
-
async executeParsers() {
|
|
446
|
-
let { output: e } = this;
|
|
447
|
-
await this.fileParser.parse();
|
|
448
|
-
let t = Object.values(this.parsers).map((async (t) => {
|
|
449
|
-
let i = await t.parse();
|
|
450
|
-
t.assignToOutput(e, i);
|
|
451
|
-
}));
|
|
452
|
-
this.options.silentErrors && (t = t.map(((e) => e.catch(this.pushToErrors)))), await Promise.all(t);
|
|
453
|
-
}
|
|
454
|
-
async extractThumbnail() {
|
|
455
|
-
this.setup();
|
|
456
|
-
let { options: e, file: t } = this, i = A.get("tiff", e);
|
|
457
|
-
var n;
|
|
458
|
-
if (t.tiff ? n = {
|
|
459
|
-
start: 0,
|
|
460
|
-
type: "tiff"
|
|
461
|
-
} : t.jpeg && (n = await this.fileParser.getOrFindSegment("tiff")), void 0 === n) return;
|
|
462
|
-
let s = await this.fileParser.ensureSegmentChunk(n), a = await (this.parsers.tiff = new i(s, e, t)).extractThumbnail();
|
|
463
|
-
return t.close && t.close(), a;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
async function fe(e, t) {
|
|
467
|
-
let i = new ce(t);
|
|
468
|
-
return await i.read(e), i.parse();
|
|
469
|
-
}
|
|
470
|
-
var de = Object.freeze({
|
|
471
|
-
__proto__: null,
|
|
472
|
-
parse: fe,
|
|
473
|
-
Exifr: ce,
|
|
474
|
-
fileParsers: T,
|
|
475
|
-
segmentParsers: A,
|
|
476
|
-
fileReaders: D,
|
|
477
|
-
tagKeys: N,
|
|
478
|
-
tagValues: G,
|
|
479
|
-
tagRevivers: V,
|
|
480
|
-
createDictionary: B,
|
|
481
|
-
extendDictionary: E,
|
|
482
|
-
fetchUrlAsArrayBuffer: L,
|
|
483
|
-
readBlobAsArrayBuffer: U,
|
|
484
|
-
chunkedProps: $,
|
|
485
|
-
otherSegments: J,
|
|
486
|
-
segments: q,
|
|
487
|
-
tiffBlocks: Q,
|
|
488
|
-
segmentsAndBlocks: Z,
|
|
489
|
-
tiffExtractables: ee,
|
|
490
|
-
inheritables: te,
|
|
491
|
-
allFormatters: ie,
|
|
492
|
-
Options: oe
|
|
493
|
-
});
|
|
494
|
-
class pe {
|
|
495
|
-
constructor(e, t, i) {
|
|
496
|
-
f(this, "errors", []), f(this, "ensureSegmentChunk", (async (e) => {
|
|
497
|
-
let t = e.start, i = e.size || 65536;
|
|
498
|
-
if (this.file.chunked) if (this.file.available(t, i)) e.chunk = this.file.subarray(t, i);
|
|
499
|
-
else try {
|
|
500
|
-
e.chunk = await this.file.readChunk(t, i);
|
|
501
|
-
} catch (t) {
|
|
502
|
-
m(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`);
|
|
503
|
-
}
|
|
504
|
-
else this.file.byteLength > t + i ? e.chunk = this.file.subarray(t, i) : void 0 === e.size ? e.chunk = this.file.subarray(t) : m("Segment unreachable: " + JSON.stringify(e));
|
|
505
|
-
return e.chunk;
|
|
506
|
-
})), this.extendOptions && this.extendOptions(e), this.options = e, this.file = t, this.parsers = i;
|
|
507
|
-
}
|
|
508
|
-
injectSegment(e, t) {
|
|
509
|
-
this.options[e].enabled && this.createParser(e, t);
|
|
510
|
-
}
|
|
511
|
-
createParser(e, t) {
|
|
512
|
-
let i = new (A.get(e))(t, this.options, this.file);
|
|
513
|
-
return this.parsers[e] = i;
|
|
514
|
-
}
|
|
515
|
-
createParsers(e) {
|
|
516
|
-
for (let t of e) {
|
|
517
|
-
let { type: e, chunk: i } = t, n = this.options[e];
|
|
518
|
-
if (n && n.enabled) {
|
|
519
|
-
let t = this.parsers[e];
|
|
520
|
-
t && t.append || t || this.createParser(e, i);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
async readSegments(e) {
|
|
525
|
-
let t = e.map(this.ensureSegmentChunk);
|
|
526
|
-
await Promise.all(t);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
class ge {
|
|
530
|
-
static findPosition(e, t) {
|
|
531
|
-
let i = e.getUint16(t + 2) + 2, n = "function" == typeof this.headerLength ? this.headerLength(e, t, i) : this.headerLength, s = t + n, r = i - n;
|
|
532
|
-
return {
|
|
533
|
-
offset: t,
|
|
534
|
-
length: i,
|
|
535
|
-
headerLength: n,
|
|
536
|
-
start: s,
|
|
537
|
-
size: r,
|
|
538
|
-
end: s + r
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
static parse(e, t = {}) {
|
|
542
|
-
return new this(e, new oe({ [this.type]: t }), e).parse();
|
|
543
|
-
}
|
|
544
|
-
normalizeInput(e) {
|
|
545
|
-
return e instanceof I ? e : new I(e);
|
|
546
|
-
}
|
|
547
|
-
constructor(e, t = {}, i) {
|
|
548
|
-
f(this, "errors", []), f(this, "raw", /* @__PURE__ */ new Map()), f(this, "handleError", ((e) => {
|
|
549
|
-
if (!this.options.silentErrors) throw e;
|
|
550
|
-
this.errors.push(e.message);
|
|
551
|
-
})), this.chunk = this.normalizeInput(e), this.file = i, this.type = this.constructor.type, this.globalOptions = this.options = t, this.localOptions = t[this.type], this.canTranslate = this.localOptions && this.localOptions.translate;
|
|
552
|
-
}
|
|
553
|
-
translate() {
|
|
554
|
-
this.canTranslate && (this.translated = this.translateBlock(this.raw, this.type));
|
|
555
|
-
}
|
|
556
|
-
get output() {
|
|
557
|
-
return this.translated ? this.translated : this.raw ? Object.fromEntries(this.raw) : void 0;
|
|
558
|
-
}
|
|
559
|
-
translateBlock(e, t) {
|
|
560
|
-
let i = V.get(t), n = G.get(t), s = N.get(t), r = this.options[t], a = r.reviveValues && !!i, o = r.translateValues && !!n, l = r.translateKeys && !!s, h = {};
|
|
561
|
-
for (let [t, r] of e) a && i.has(t) ? r = i.get(t)(r) : o && n.has(t) && (r = this.translateValue(r, n.get(t))), l && s.has(t) && (t = s.get(t) || t), h[t] = r;
|
|
562
|
-
return h;
|
|
563
|
-
}
|
|
564
|
-
translateValue(e, t) {
|
|
565
|
-
return t[e] || t.DEFAULT || e;
|
|
566
|
-
}
|
|
567
|
-
assignToOutput(e, t) {
|
|
568
|
-
this.assignObjectToOutput(e, this.constructor.type, t);
|
|
569
|
-
}
|
|
570
|
-
assignObjectToOutput(e, t, i) {
|
|
571
|
-
if (this.globalOptions.mergeOutput) return Object.assign(e, i);
|
|
572
|
-
e[t] ? Object.assign(e[t], i) : e[t] = i;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
f(ge, "headerLength", 4), f(ge, "type", void 0), f(ge, "multiSegment", !1), f(ge, "canHandle", (() => !1));
|
|
576
|
-
function me(e) {
|
|
577
|
-
return 192 === e || 194 === e || 196 === e || 219 === e || 221 === e || 218 === e || 254 === e;
|
|
578
|
-
}
|
|
579
|
-
function Se(e) {
|
|
580
|
-
return e >= 224 && e <= 239;
|
|
581
|
-
}
|
|
582
|
-
function Ce(e, t, i) {
|
|
583
|
-
for (let [n, s] of A) if (s.canHandle(e, t, i)) return n;
|
|
584
|
-
}
|
|
585
|
-
class ye extends pe {
|
|
586
|
-
constructor(...e) {
|
|
587
|
-
super(...e), f(this, "appSegments", []), f(this, "jpegSegments", []), f(this, "unknownSegments", []);
|
|
588
|
-
}
|
|
589
|
-
static canHandle(e, t) {
|
|
590
|
-
return 65496 === t;
|
|
591
|
-
}
|
|
592
|
-
async parse() {
|
|
593
|
-
await this.findAppSegments(), await this.readSegments(this.appSegments), this.mergeMultiSegments(), this.createParsers(this.mergedAppSegments || this.appSegments);
|
|
594
|
-
}
|
|
595
|
-
setupSegmentFinderArgs(e) {
|
|
596
|
-
!0 === e ? (this.findAll = !0, this.wanted = new Set(A.keyList())) : (e = void 0 === e ? A.keyList().filter(((e) => this.options[e].enabled)) : e.filter(((e) => this.options[e].enabled && A.has(e))), this.findAll = !1, this.remaining = new Set(e), this.wanted = new Set(e)), this.unfinishedMultiSegment = !1;
|
|
597
|
-
}
|
|
598
|
-
async findAppSegments(e = 0, t) {
|
|
599
|
-
this.setupSegmentFinderArgs(t);
|
|
600
|
-
let { file: i, findAll: n, wanted: s, remaining: r } = this;
|
|
601
|
-
if (!n && this.file.chunked && (n = Array.from(s).some(((e) => {
|
|
602
|
-
let t = A.get(e), i = this.options[e];
|
|
603
|
-
return t.multiSegment && i.multiSegment;
|
|
604
|
-
})), n && await this.file.readWhole()), e = this.findAppSegmentsInRange(e, i.byteLength), !this.options.onlyTiff && i.chunked) {
|
|
605
|
-
let t = !1;
|
|
606
|
-
for (; r.size > 0 && !t && (i.canReadNextChunk || this.unfinishedMultiSegment);) {
|
|
607
|
-
let { nextChunkOffset: n } = i, s = this.appSegments.some(((e) => !this.file.available(e.offset || e.start, e.length || e.size)));
|
|
608
|
-
if (t = e > n && !s ? !await i.readNextChunk(e) : !await i.readNextChunk(n), void 0 === (e = this.findAppSegmentsInRange(e, i.byteLength))) return;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
findAppSegmentsInRange(e, t) {
|
|
613
|
-
t -= 2;
|
|
614
|
-
let i, n, s, r, a, o, { file: l, findAll: h, wanted: u, remaining: c, options: f } = this;
|
|
615
|
-
for (; e < t; e++) if (255 === l.getUint8(e)) {
|
|
616
|
-
if (i = l.getUint8(e + 1), Se(i)) {
|
|
617
|
-
if (n = l.getUint16(e + 2), s = Ce(l, e, n), s && u.has(s) && (r = A.get(s), a = r.findPosition(l, e), o = f[s], a.type = s, this.appSegments.push(a), !h && (r.multiSegment && o.multiSegment ? (this.unfinishedMultiSegment = a.chunkNumber < a.chunkCount, this.unfinishedMultiSegment || c.delete(s)) : c.delete(s), 0 === c.size))) break;
|
|
618
|
-
f.recordUnknownSegments && (a = ge.findPosition(l, e), a.marker = i, this.unknownSegments.push(a)), e += n + 1;
|
|
619
|
-
} else if (me(i)) {
|
|
620
|
-
if (n = l.getUint16(e + 2), 218 === i && !1 !== f.stopAfterSos) return;
|
|
621
|
-
f.recordJpegSegments && this.jpegSegments.push({
|
|
622
|
-
offset: e,
|
|
623
|
-
length: n,
|
|
624
|
-
marker: i
|
|
625
|
-
}), e += n + 1;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
return e;
|
|
629
|
-
}
|
|
630
|
-
mergeMultiSegments() {
|
|
631
|
-
if (!this.appSegments.some(((e) => e.multiSegment))) return;
|
|
632
|
-
let e = function(e, t) {
|
|
633
|
-
let i, n, s, r = /* @__PURE__ */ new Map();
|
|
634
|
-
for (let a = 0; a < e.length; a++) i = e[a], n = i[t], r.has(n) ? s = r.get(n) : r.set(n, s = []), s.push(i);
|
|
635
|
-
return Array.from(r);
|
|
636
|
-
}(this.appSegments, "type");
|
|
637
|
-
this.mergedAppSegments = e.map((([e, t]) => {
|
|
638
|
-
let i = A.get(e, this.options);
|
|
639
|
-
if (i.handleMultiSegments) return {
|
|
640
|
-
type: e,
|
|
641
|
-
chunk: i.handleMultiSegments(t)
|
|
642
|
-
};
|
|
643
|
-
return t[0];
|
|
644
|
-
}));
|
|
645
|
-
}
|
|
646
|
-
getSegment(e) {
|
|
647
|
-
return this.appSegments.find(((t) => t.type === e));
|
|
648
|
-
}
|
|
649
|
-
async getOrFindSegment(e) {
|
|
650
|
-
let t = this.getSegment(e);
|
|
651
|
-
return void 0 === t && (await this.findAppSegments(0, [e]), t = this.getSegment(e)), t;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
f(ye, "type", "jpeg"), T.set("jpeg", ye);
|
|
655
|
-
const be = [
|
|
656
|
-
void 0,
|
|
657
|
-
1,
|
|
658
|
-
1,
|
|
659
|
-
2,
|
|
660
|
-
4,
|
|
661
|
-
8,
|
|
662
|
-
1,
|
|
663
|
-
1,
|
|
664
|
-
2,
|
|
665
|
-
4,
|
|
666
|
-
8,
|
|
667
|
-
4,
|
|
668
|
-
8,
|
|
669
|
-
4
|
|
670
|
-
];
|
|
671
|
-
class Pe extends ge {
|
|
672
|
-
parseHeader() {
|
|
673
|
-
var e = this.chunk.getUint16();
|
|
674
|
-
18761 === e ? this.le = !0 : 19789 === e && (this.le = !1), this.chunk.le = this.le, this.headerParsed = !0;
|
|
675
|
-
}
|
|
676
|
-
parseTags(e, t, i = /* @__PURE__ */ new Map()) {
|
|
677
|
-
let { pick: n, skip: s } = this.options[t];
|
|
678
|
-
n = new Set(n);
|
|
679
|
-
let r = n.size > 0, a = 0 === s.size, o = this.chunk.getUint16(e);
|
|
680
|
-
e += 2;
|
|
681
|
-
for (let l = 0; l < o; l++) {
|
|
682
|
-
let o = this.chunk.getUint16(e);
|
|
683
|
-
if (r) {
|
|
684
|
-
if (n.has(o) && (i.set(o, this.parseTag(e, o, t)), n.delete(o), 0 === n.size)) break;
|
|
685
|
-
} else !a && s.has(o) || i.set(o, this.parseTag(e, o, t));
|
|
686
|
-
e += 12;
|
|
687
|
-
}
|
|
688
|
-
return i;
|
|
689
|
-
}
|
|
690
|
-
parseTag(e, t, i) {
|
|
691
|
-
let { chunk: n } = this, s = n.getUint16(e + 2), r = n.getUint32(e + 4), a = be[s];
|
|
692
|
-
if (a * r <= 4 ? e += 8 : e = n.getUint32(e + 8), (s < 1 || s > 13) && m(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`), e > n.byteLength && m(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`), 1 === s) return n.getUint8Array(e, r);
|
|
693
|
-
if (2 === s) return S(n.getString(e, r));
|
|
694
|
-
if (7 === s) return n.getUint8Array(e, r);
|
|
695
|
-
if (1 === r) return this.parseTagValue(s, e);
|
|
696
|
-
{
|
|
697
|
-
let t = new (function(e) {
|
|
698
|
-
switch (e) {
|
|
699
|
-
case 1: return Uint8Array;
|
|
700
|
-
case 3: return Uint16Array;
|
|
701
|
-
case 4: return Uint32Array;
|
|
702
|
-
case 5: return Array;
|
|
703
|
-
case 6: return Int8Array;
|
|
704
|
-
case 8: return Int16Array;
|
|
705
|
-
case 9: return Int32Array;
|
|
706
|
-
case 10: return Array;
|
|
707
|
-
case 11: return Float32Array;
|
|
708
|
-
case 12: return Float64Array;
|
|
709
|
-
default: return Array;
|
|
710
|
-
}
|
|
711
|
-
}(s))(r), i = a;
|
|
712
|
-
for (let n = 0; n < r; n++) t[n] = this.parseTagValue(s, e), e += i;
|
|
713
|
-
return t;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
parseTagValue(e, t) {
|
|
717
|
-
let { chunk: i } = this;
|
|
718
|
-
switch (e) {
|
|
719
|
-
case 1: return i.getUint8(t);
|
|
720
|
-
case 3: return i.getUint16(t);
|
|
721
|
-
case 4: return i.getUint32(t);
|
|
722
|
-
case 5: return i.getUint32(t) / i.getUint32(t + 4);
|
|
723
|
-
case 6: return i.getInt8(t);
|
|
724
|
-
case 8: return i.getInt16(t);
|
|
725
|
-
case 9: return i.getInt32(t);
|
|
726
|
-
case 10: return i.getInt32(t) / i.getInt32(t + 4);
|
|
727
|
-
case 11: return i.getFloat(t);
|
|
728
|
-
case 12: return i.getDouble(t);
|
|
729
|
-
case 13: return i.getUint32(t);
|
|
730
|
-
default: m(`Invalid tiff type ${e}`);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
class Ie extends Pe {
|
|
735
|
-
static canHandle(e, t) {
|
|
736
|
-
return 225 === e.getUint8(t + 1) && 1165519206 === e.getUint32(t + 4) && 0 === e.getUint16(t + 8);
|
|
737
|
-
}
|
|
738
|
-
async parse() {
|
|
739
|
-
this.parseHeader();
|
|
740
|
-
let { options: e } = this;
|
|
741
|
-
return e.ifd0.enabled && await this.parseIfd0Block(), e.exif.enabled && await this.safeParse("parseExifBlock"), e.gps.enabled && await this.safeParse("parseGpsBlock"), e.interop.enabled && await this.safeParse("parseInteropBlock"), e.ifd1.enabled && await this.safeParse("parseThumbnailBlock"), this.createOutput();
|
|
742
|
-
}
|
|
743
|
-
safeParse(e) {
|
|
744
|
-
let t = this[e]();
|
|
745
|
-
return void 0 !== t.catch && (t = t.catch(this.handleError)), t;
|
|
746
|
-
}
|
|
747
|
-
findIfd0Offset() {
|
|
748
|
-
void 0 === this.ifd0Offset && (this.ifd0Offset = this.chunk.getUint32(4));
|
|
749
|
-
}
|
|
750
|
-
findIfd1Offset() {
|
|
751
|
-
if (void 0 === this.ifd1Offset) {
|
|
752
|
-
this.findIfd0Offset();
|
|
753
|
-
let e = this.chunk.getUint16(this.ifd0Offset), t = this.ifd0Offset + 2 + 12 * e;
|
|
754
|
-
this.ifd1Offset = this.chunk.getUint32(t);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
parseBlock(e, t) {
|
|
758
|
-
let i = /* @__PURE__ */ new Map();
|
|
759
|
-
return this[t] = i, this.parseTags(e, t, i), i;
|
|
760
|
-
}
|
|
761
|
-
async parseIfd0Block() {
|
|
762
|
-
if (this.ifd0) return;
|
|
763
|
-
let { file: e } = this;
|
|
764
|
-
this.findIfd0Offset(), this.ifd0Offset < 8 && m("Malformed EXIF data"), !e.chunked && this.ifd0Offset > e.byteLength && m(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`), e.tiff && await e.ensureChunk(this.ifd0Offset, C(this.options));
|
|
765
|
-
let t = this.parseBlock(this.ifd0Offset, "ifd0");
|
|
766
|
-
return 0 !== t.size ? (this.exifOffset = t.get(X), this.interopOffset = t.get(Y), this.gpsOffset = t.get(_), this.xmp = t.get(j), this.iptc = t.get(W), this.icc = t.get(K), this.options.sanitize && (t.delete(X), t.delete(Y), t.delete(_), t.delete(j), t.delete(W), t.delete(K)), t) : void 0;
|
|
767
|
-
}
|
|
768
|
-
async parseExifBlock() {
|
|
769
|
-
if (this.exif) return;
|
|
770
|
-
if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.exifOffset) return;
|
|
771
|
-
this.file.tiff && await this.file.ensureChunk(this.exifOffset, C(this.options));
|
|
772
|
-
let e = this.parseBlock(this.exifOffset, "exif");
|
|
773
|
-
return this.interopOffset || (this.interopOffset = e.get(Y)), this.makerNote = e.get(z), this.userComment = e.get(H), this.options.sanitize && (e.delete(Y), e.delete(z), e.delete(H)), this.unpack(e, 41728), this.unpack(e, 41729), e;
|
|
774
|
-
}
|
|
775
|
-
unpack(e, t) {
|
|
776
|
-
let i = e.get(t);
|
|
777
|
-
i && 1 === i.length && e.set(t, i[0]);
|
|
778
|
-
}
|
|
779
|
-
async parseGpsBlock() {
|
|
780
|
-
if (this.gps) return;
|
|
781
|
-
if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.gpsOffset) return;
|
|
782
|
-
let e = this.parseBlock(this.gpsOffset, "gps");
|
|
783
|
-
return e && e.has(2) && e.has(4) && (e.set("latitude", ke(...e.get(2), e.get(1))), e.set("longitude", ke(...e.get(4), e.get(3)))), e;
|
|
784
|
-
}
|
|
785
|
-
async parseInteropBlock() {
|
|
786
|
-
if (!this.interop && (this.ifd0 || await this.parseIfd0Block(), void 0 !== this.interopOffset || this.exif || await this.parseExifBlock(), void 0 !== this.interopOffset)) return this.parseBlock(this.interopOffset, "interop");
|
|
787
|
-
}
|
|
788
|
-
async parseThumbnailBlock(e = !1) {
|
|
789
|
-
if (!this.ifd1 && !this.ifd1Parsed && (!this.options.mergeOutput || e)) return this.findIfd1Offset(), this.ifd1Offset > 0 && (this.parseBlock(this.ifd1Offset, "ifd1"), this.ifd1Parsed = !0), this.ifd1;
|
|
790
|
-
}
|
|
791
|
-
async extractThumbnail() {
|
|
792
|
-
if (this.headerParsed || this.parseHeader(), this.ifd1Parsed || await this.parseThumbnailBlock(!0), void 0 === this.ifd1) return;
|
|
793
|
-
let e = this.ifd1.get(513), t = this.ifd1.get(514);
|
|
794
|
-
return this.chunk.getUint8Array(e, t);
|
|
795
|
-
}
|
|
796
|
-
get image() {
|
|
797
|
-
return this.ifd0;
|
|
798
|
-
}
|
|
799
|
-
get thumbnail() {
|
|
800
|
-
return this.ifd1;
|
|
801
|
-
}
|
|
802
|
-
createOutput() {
|
|
803
|
-
let e, t, i, n = {};
|
|
804
|
-
for (t of Q) if (e = this[t], !g(e)) if (i = this.canTranslate ? this.translateBlock(e, t) : Object.fromEntries(e), this.options.mergeOutput) {
|
|
805
|
-
if ("ifd1" === t) continue;
|
|
806
|
-
Object.assign(n, i);
|
|
807
|
-
} else n[t] = i;
|
|
808
|
-
return this.makerNote && (n.makerNote = this.makerNote), this.userComment && (n.userComment = this.userComment), n;
|
|
809
|
-
}
|
|
810
|
-
assignToOutput(e, t) {
|
|
811
|
-
if (this.globalOptions.mergeOutput) Object.assign(e, t);
|
|
812
|
-
else for (let [i, n] of Object.entries(t)) this.assignObjectToOutput(e, i, n);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
function ke(e, t, i, n) {
|
|
816
|
-
var s = e + t / 60 + i / 3600;
|
|
817
|
-
return "S" !== n && "W" !== n || (s *= -1), s;
|
|
818
|
-
}
|
|
819
|
-
f(Ie, "type", "tiff"), f(Ie, "headerLength", 10), A.set("tiff", Ie);
|
|
820
|
-
var we = Object.freeze({
|
|
821
|
-
__proto__: null,
|
|
822
|
-
default: de,
|
|
823
|
-
Exifr: ce,
|
|
824
|
-
fileParsers: T,
|
|
825
|
-
segmentParsers: A,
|
|
826
|
-
fileReaders: D,
|
|
827
|
-
tagKeys: N,
|
|
828
|
-
tagValues: G,
|
|
829
|
-
tagRevivers: V,
|
|
830
|
-
createDictionary: B,
|
|
831
|
-
extendDictionary: E,
|
|
832
|
-
fetchUrlAsArrayBuffer: L,
|
|
833
|
-
readBlobAsArrayBuffer: U,
|
|
834
|
-
chunkedProps: $,
|
|
835
|
-
otherSegments: J,
|
|
836
|
-
segments: q,
|
|
837
|
-
tiffBlocks: Q,
|
|
838
|
-
segmentsAndBlocks: Z,
|
|
839
|
-
tiffExtractables: ee,
|
|
840
|
-
inheritables: te,
|
|
841
|
-
allFormatters: ie,
|
|
842
|
-
Options: oe,
|
|
843
|
-
parse: fe
|
|
844
|
-
});
|
|
845
|
-
const Te = {
|
|
846
|
-
ifd0: !1,
|
|
847
|
-
ifd1: !1,
|
|
848
|
-
exif: !1,
|
|
849
|
-
gps: !1,
|
|
850
|
-
interop: !1,
|
|
851
|
-
sanitize: !1,
|
|
852
|
-
reviveValues: !0,
|
|
853
|
-
translateKeys: !1,
|
|
854
|
-
translateValues: !1,
|
|
855
|
-
mergeOutput: !1
|
|
856
|
-
}, Ae = Object.assign({}, Te, {
|
|
857
|
-
firstChunkSize: 4e4,
|
|
858
|
-
gps: [
|
|
859
|
-
1,
|
|
860
|
-
2,
|
|
861
|
-
3,
|
|
862
|
-
4
|
|
863
|
-
]
|
|
864
|
-
});
|
|
865
|
-
async function De(e) {
|
|
866
|
-
let t = new ce(Ae);
|
|
867
|
-
await t.read(e);
|
|
868
|
-
let i = await t.parse();
|
|
869
|
-
if (i && i.gps) {
|
|
870
|
-
let { latitude: e, longitude: t } = i.gps;
|
|
871
|
-
return {
|
|
872
|
-
latitude: e,
|
|
873
|
-
longitude: t
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
const Oe = Object.assign({}, Te, {
|
|
878
|
-
tiff: !1,
|
|
879
|
-
ifd1: !0,
|
|
880
|
-
mergeOutput: !1
|
|
881
|
-
});
|
|
882
|
-
async function xe(e) {
|
|
883
|
-
let t = new ce(Oe);
|
|
884
|
-
await t.read(e);
|
|
885
|
-
let i = await t.extractThumbnail();
|
|
886
|
-
return i && o ? r.from(i) : i;
|
|
887
|
-
}
|
|
888
|
-
async function ve(e) {
|
|
889
|
-
let t = await this.thumbnail(e);
|
|
890
|
-
if (void 0 !== t) {
|
|
891
|
-
let e = new Blob([t]);
|
|
892
|
-
return URL.createObjectURL(e);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
const Me = Object.assign({}, Te, {
|
|
896
|
-
firstChunkSize: 4e4,
|
|
897
|
-
ifd0: [274]
|
|
898
|
-
});
|
|
899
|
-
async function Re(e) {
|
|
900
|
-
let t = new ce(Me);
|
|
901
|
-
await t.read(e);
|
|
902
|
-
let i = await t.parse();
|
|
903
|
-
if (i && i.ifd0) return i.ifd0[274];
|
|
904
|
-
}
|
|
905
|
-
const Le = Object.freeze({
|
|
906
|
-
1: {
|
|
907
|
-
dimensionSwapped: !1,
|
|
908
|
-
scaleX: 1,
|
|
909
|
-
scaleY: 1,
|
|
910
|
-
deg: 0,
|
|
911
|
-
rad: 0
|
|
912
|
-
},
|
|
913
|
-
2: {
|
|
914
|
-
dimensionSwapped: !1,
|
|
915
|
-
scaleX: -1,
|
|
916
|
-
scaleY: 1,
|
|
917
|
-
deg: 0,
|
|
918
|
-
rad: 0
|
|
919
|
-
},
|
|
920
|
-
3: {
|
|
921
|
-
dimensionSwapped: !1,
|
|
922
|
-
scaleX: 1,
|
|
923
|
-
scaleY: 1,
|
|
924
|
-
deg: 180,
|
|
925
|
-
rad: 180 * Math.PI / 180
|
|
926
|
-
},
|
|
927
|
-
4: {
|
|
928
|
-
dimensionSwapped: !1,
|
|
929
|
-
scaleX: -1,
|
|
930
|
-
scaleY: 1,
|
|
931
|
-
deg: 180,
|
|
932
|
-
rad: 180 * Math.PI / 180
|
|
933
|
-
},
|
|
934
|
-
5: {
|
|
935
|
-
dimensionSwapped: !0,
|
|
936
|
-
scaleX: 1,
|
|
937
|
-
scaleY: -1,
|
|
938
|
-
deg: 90,
|
|
939
|
-
rad: 90 * Math.PI / 180
|
|
940
|
-
},
|
|
941
|
-
6: {
|
|
942
|
-
dimensionSwapped: !0,
|
|
943
|
-
scaleX: 1,
|
|
944
|
-
scaleY: 1,
|
|
945
|
-
deg: 90,
|
|
946
|
-
rad: 90 * Math.PI / 180
|
|
947
|
-
},
|
|
948
|
-
7: {
|
|
949
|
-
dimensionSwapped: !0,
|
|
950
|
-
scaleX: 1,
|
|
951
|
-
scaleY: -1,
|
|
952
|
-
deg: 270,
|
|
953
|
-
rad: 270 * Math.PI / 180
|
|
954
|
-
},
|
|
955
|
-
8: {
|
|
956
|
-
dimensionSwapped: !0,
|
|
957
|
-
scaleX: 1,
|
|
958
|
-
scaleY: 1,
|
|
959
|
-
deg: 270,
|
|
960
|
-
rad: 270 * Math.PI / 180
|
|
961
|
-
}
|
|
962
|
-
});
|
|
963
|
-
if (e.rotateCanvas = !0, e.rotateCss = !0, "object" == typeof navigator) {
|
|
964
|
-
let t = navigator.userAgent;
|
|
965
|
-
if (t.includes("iPad") || t.includes("iPhone")) {
|
|
966
|
-
let i = t.match(/OS (\d+)_(\d+)/);
|
|
967
|
-
if (i) {
|
|
968
|
-
let [, t, n] = i;
|
|
969
|
-
e.rotateCanvas = Number(t) + .1 * Number(n) < 13.4, e.rotateCss = !1;
|
|
970
|
-
}
|
|
971
|
-
} else if (t.includes("OS X 10")) {
|
|
972
|
-
let [, i] = t.match(/OS X 10[_.](\d+)/);
|
|
973
|
-
e.rotateCanvas = e.rotateCss = Number(i) < 15;
|
|
974
|
-
}
|
|
975
|
-
if (t.includes("Chrome/")) {
|
|
976
|
-
let [, i] = t.match(/Chrome\/(\d+)/);
|
|
977
|
-
e.rotateCanvas = e.rotateCss = Number(i) < 81;
|
|
978
|
-
} else if (t.includes("Firefox/")) {
|
|
979
|
-
let [, i] = t.match(/Firefox\/(\d+)/);
|
|
980
|
-
e.rotateCanvas = e.rotateCss = Number(i) < 77;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
async function Ue(t) {
|
|
984
|
-
let i = await Re(t);
|
|
985
|
-
return Object.assign({
|
|
986
|
-
canvas: e.rotateCanvas,
|
|
987
|
-
css: e.rotateCss
|
|
988
|
-
}, Le[i]);
|
|
989
|
-
}
|
|
990
|
-
class Fe extends I {
|
|
991
|
-
constructor(...e) {
|
|
992
|
-
super(...e), f(this, "ranges", new Be()), 0 !== this.byteLength && this.ranges.add(0, this.byteLength);
|
|
993
|
-
}
|
|
994
|
-
_tryExtend(e, t, i) {
|
|
995
|
-
if (0 === e && 0 === this.byteLength && i) {
|
|
996
|
-
let e = new DataView(i.buffer || i, i.byteOffset, i.byteLength);
|
|
997
|
-
this._swapDataView(e);
|
|
998
|
-
} else {
|
|
999
|
-
let i = e + t;
|
|
1000
|
-
if (i > this.byteLength) {
|
|
1001
|
-
let { dataView: e } = this._extend(i);
|
|
1002
|
-
this._swapDataView(e);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
_extend(e) {
|
|
1007
|
-
let t;
|
|
1008
|
-
t = o ? r.allocUnsafe(e) : new Uint8Array(e);
|
|
1009
|
-
let i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
1010
|
-
return t.set(new Uint8Array(this.buffer, this.byteOffset, this.byteLength), 0), {
|
|
1011
|
-
uintView: t,
|
|
1012
|
-
dataView: i
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
subarray(e, t, i = !1) {
|
|
1016
|
-
return t = t || this._lengthToEnd(e), i && this._tryExtend(e, t), this.ranges.add(e, t), super.subarray(e, t);
|
|
1017
|
-
}
|
|
1018
|
-
set(e, t, i = !1) {
|
|
1019
|
-
i && this._tryExtend(t, e.byteLength, e);
|
|
1020
|
-
let n = super.set(e, t);
|
|
1021
|
-
return this.ranges.add(t, n.byteLength), n;
|
|
1022
|
-
}
|
|
1023
|
-
async ensureChunk(e, t) {
|
|
1024
|
-
this.chunked && (this.ranges.available(e, t) || await this.readChunk(e, t));
|
|
1025
|
-
}
|
|
1026
|
-
available(e, t) {
|
|
1027
|
-
return this.ranges.available(e, t);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
class Be {
|
|
1031
|
-
constructor() {
|
|
1032
|
-
f(this, "list", []);
|
|
1033
|
-
}
|
|
1034
|
-
get length() {
|
|
1035
|
-
return this.list.length;
|
|
1036
|
-
}
|
|
1037
|
-
add(e, t, i = 0) {
|
|
1038
|
-
let n = e + t, s = this.list.filter(((t) => Ee(e, t.offset, n) || Ee(e, t.end, n)));
|
|
1039
|
-
if (s.length > 0) {
|
|
1040
|
-
e = Math.min(e, ...s.map(((e) => e.offset))), n = Math.max(n, ...s.map(((e) => e.end))), t = n - e;
|
|
1041
|
-
let i = s.shift();
|
|
1042
|
-
i.offset = e, i.length = t, i.end = n, this.list = this.list.filter(((e) => !s.includes(e)));
|
|
1043
|
-
} else this.list.push({
|
|
1044
|
-
offset: e,
|
|
1045
|
-
length: t,
|
|
1046
|
-
end: n
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
available(e, t) {
|
|
1050
|
-
let i = e + t;
|
|
1051
|
-
return this.list.some(((t) => t.offset <= e && i <= t.end));
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
function Ee(e, t, i) {
|
|
1055
|
-
return e <= t && t <= i;
|
|
1056
|
-
}
|
|
1057
|
-
class Ne extends Fe {
|
|
1058
|
-
constructor(e, t) {
|
|
1059
|
-
super(0), f(this, "chunksRead", 0), this.input = e, this.options = t;
|
|
1060
|
-
}
|
|
1061
|
-
async readWhole() {
|
|
1062
|
-
this.chunked = !1, await this.readChunk(this.nextChunkOffset);
|
|
1063
|
-
}
|
|
1064
|
-
async readChunked() {
|
|
1065
|
-
this.chunked = !0, await this.readChunk(0, this.options.firstChunkSize);
|
|
1066
|
-
}
|
|
1067
|
-
async readNextChunk(e = this.nextChunkOffset) {
|
|
1068
|
-
if (this.fullyRead) return this.chunksRead++, !1;
|
|
1069
|
-
let t = this.options.chunkSize, i = await this.readChunk(e, t);
|
|
1070
|
-
return !!i && i.byteLength === t;
|
|
1071
|
-
}
|
|
1072
|
-
async readChunk(e, t) {
|
|
1073
|
-
if (this.chunksRead++, 0 !== (t = this.safeWrapAddress(e, t))) return this._readChunk(e, t);
|
|
1074
|
-
}
|
|
1075
|
-
safeWrapAddress(e, t) {
|
|
1076
|
-
return void 0 !== this.size && e + t > this.size ? Math.max(0, this.size - e) : t;
|
|
1077
|
-
}
|
|
1078
|
-
get nextChunkOffset() {
|
|
1079
|
-
if (0 !== this.ranges.list.length) return this.ranges.list[0].length;
|
|
1080
|
-
}
|
|
1081
|
-
get canReadNextChunk() {
|
|
1082
|
-
return this.chunksRead < this.options.chunkLimit;
|
|
1083
|
-
}
|
|
1084
|
-
get fullyRead() {
|
|
1085
|
-
return void 0 !== this.size && this.nextChunkOffset === this.size;
|
|
1086
|
-
}
|
|
1087
|
-
read() {
|
|
1088
|
-
return this.options.chunked ? this.readChunked() : this.readWhole();
|
|
1089
|
-
}
|
|
1090
|
-
close() {}
|
|
1091
|
-
}
|
|
1092
|
-
D.set("blob", class extends Ne {
|
|
1093
|
-
async readWhole() {
|
|
1094
|
-
this.chunked = !1;
|
|
1095
|
-
let e = await U(this.input);
|
|
1096
|
-
this._swapArrayBuffer(e);
|
|
1097
|
-
}
|
|
1098
|
-
readChunked() {
|
|
1099
|
-
return this.chunked = !0, this.size = this.input.size, super.readChunked();
|
|
1100
|
-
}
|
|
1101
|
-
async _readChunk(e, t) {
|
|
1102
|
-
let i = t ? e + t : void 0, n = this.input.slice(e, i), s = await U(n);
|
|
1103
|
-
return this.set(s, e, !0);
|
|
1104
|
-
}
|
|
1105
|
-
});
|
|
1106
|
-
var Ge = Object.freeze({
|
|
1107
|
-
__proto__: null,
|
|
1108
|
-
default: we,
|
|
1109
|
-
Exifr: ce,
|
|
1110
|
-
fileParsers: T,
|
|
1111
|
-
segmentParsers: A,
|
|
1112
|
-
fileReaders: D,
|
|
1113
|
-
tagKeys: N,
|
|
1114
|
-
tagValues: G,
|
|
1115
|
-
tagRevivers: V,
|
|
1116
|
-
createDictionary: B,
|
|
1117
|
-
extendDictionary: E,
|
|
1118
|
-
fetchUrlAsArrayBuffer: L,
|
|
1119
|
-
readBlobAsArrayBuffer: U,
|
|
1120
|
-
chunkedProps: $,
|
|
1121
|
-
otherSegments: J,
|
|
1122
|
-
segments: q,
|
|
1123
|
-
tiffBlocks: Q,
|
|
1124
|
-
segmentsAndBlocks: Z,
|
|
1125
|
-
tiffExtractables: ee,
|
|
1126
|
-
inheritables: te,
|
|
1127
|
-
allFormatters: ie,
|
|
1128
|
-
Options: oe,
|
|
1129
|
-
parse: fe,
|
|
1130
|
-
gpsOnlyOptions: Ae,
|
|
1131
|
-
gps: De,
|
|
1132
|
-
thumbnailOnlyOptions: Oe,
|
|
1133
|
-
thumbnail: xe,
|
|
1134
|
-
thumbnailUrl: ve,
|
|
1135
|
-
orientationOnlyOptions: Me,
|
|
1136
|
-
orientation: Re,
|
|
1137
|
-
rotations: Le,
|
|
1138
|
-
get rotateCanvas() {
|
|
1139
|
-
return e.rotateCanvas;
|
|
1140
|
-
},
|
|
1141
|
-
get rotateCss() {
|
|
1142
|
-
return e.rotateCss;
|
|
1143
|
-
},
|
|
1144
|
-
rotation: Ue
|
|
1145
|
-
});
|
|
1146
|
-
D.set("url", class extends Ne {
|
|
1147
|
-
async readWhole() {
|
|
1148
|
-
this.chunked = !1;
|
|
1149
|
-
let e = await L(this.input);
|
|
1150
|
-
e instanceof ArrayBuffer ? this._swapArrayBuffer(e) : e instanceof Uint8Array && this._swapBuffer(e);
|
|
1151
|
-
}
|
|
1152
|
-
async _readChunk(e, t) {
|
|
1153
|
-
let i = t ? e + t - 1 : void 0, n = this.options.httpHeaders || {};
|
|
1154
|
-
(e || i) && (n.range = `bytes=${[e, i].join("-")}`);
|
|
1155
|
-
let s = await u(this.input, { headers: n }), r = await s.arrayBuffer(), a = r.byteLength;
|
|
1156
|
-
if (416 !== s.status) return a !== t && (this.size = e + a), this.set(r, e, !0);
|
|
1157
|
-
}
|
|
1158
|
-
});
|
|
1159
|
-
I.prototype.getUint64 = function(e) {
|
|
1160
|
-
let t = this.getUint32(e), i = this.getUint32(e + 4);
|
|
1161
|
-
return t < 1048575 ? t << 32 | i : (console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."), a(t) << a(32) | a(i));
|
|
1162
|
-
};
|
|
1163
|
-
class Ve extends pe {
|
|
1164
|
-
parseBoxes(e = 0) {
|
|
1165
|
-
let t = [];
|
|
1166
|
-
for (; e < this.file.byteLength - 4;) {
|
|
1167
|
-
let i = this.parseBoxHead(e);
|
|
1168
|
-
if (t.push(i), 0 === i.length) break;
|
|
1169
|
-
e += i.length;
|
|
1170
|
-
}
|
|
1171
|
-
return t;
|
|
1172
|
-
}
|
|
1173
|
-
parseSubBoxes(e) {
|
|
1174
|
-
e.boxes = this.parseBoxes(e.start);
|
|
1175
|
-
}
|
|
1176
|
-
findBox(e, t) {
|
|
1177
|
-
return void 0 === e.boxes && this.parseSubBoxes(e), e.boxes.find(((e) => e.kind === t));
|
|
1178
|
-
}
|
|
1179
|
-
parseBoxHead(e) {
|
|
1180
|
-
let t = this.file.getUint32(e), i = this.file.getString(e + 4, 4), n = e + 8;
|
|
1181
|
-
return 1 === t && (t = this.file.getUint64(e + 8), n += 8), {
|
|
1182
|
-
offset: e,
|
|
1183
|
-
length: t,
|
|
1184
|
-
kind: i,
|
|
1185
|
-
start: n
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
parseBoxFullHead(e) {
|
|
1189
|
-
if (void 0 !== e.version) return;
|
|
1190
|
-
e.version = this.file.getUint32(e.start) >> 24, e.start += 4;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
class ze extends Ve {
|
|
1194
|
-
static canHandle(e, t) {
|
|
1195
|
-
if (0 !== t) return !1;
|
|
1196
|
-
let i = e.getUint16(2);
|
|
1197
|
-
if (i > 50) return !1;
|
|
1198
|
-
let n = 16, s = [];
|
|
1199
|
-
for (; n < i;) s.push(e.getString(n, 4)), n += 4;
|
|
1200
|
-
return s.includes(this.type);
|
|
1201
|
-
}
|
|
1202
|
-
async parse() {
|
|
1203
|
-
let e = this.file.getUint32(0), t = this.parseBoxHead(e);
|
|
1204
|
-
for (; "meta" !== t.kind;) e += t.length, await this.file.ensureChunk(e, 16), t = this.parseBoxHead(e);
|
|
1205
|
-
await this.file.ensureChunk(t.offset, t.length), this.parseBoxFullHead(t), this.parseSubBoxes(t), this.options.icc.enabled && await this.findIcc(t), this.options.tiff.enabled && await this.findExif(t);
|
|
1206
|
-
}
|
|
1207
|
-
async registerSegment(e, t, i) {
|
|
1208
|
-
await this.file.ensureChunk(t, i);
|
|
1209
|
-
let n = this.file.subarray(t, i);
|
|
1210
|
-
this.createParser(e, n);
|
|
1211
|
-
}
|
|
1212
|
-
async findIcc(e) {
|
|
1213
|
-
let t = this.findBox(e, "iprp");
|
|
1214
|
-
if (void 0 === t) return;
|
|
1215
|
-
let i = this.findBox(t, "ipco");
|
|
1216
|
-
if (void 0 === i) return;
|
|
1217
|
-
let n = this.findBox(i, "colr");
|
|
1218
|
-
void 0 !== n && await this.registerSegment("icc", n.offset + 12, n.length);
|
|
1219
|
-
}
|
|
1220
|
-
async findExif(e) {
|
|
1221
|
-
let t = this.findBox(e, "iinf");
|
|
1222
|
-
if (void 0 === t) return;
|
|
1223
|
-
let i = this.findBox(e, "iloc");
|
|
1224
|
-
if (void 0 === i) return;
|
|
1225
|
-
let n = this.findExifLocIdInIinf(t), s = this.findExtentInIloc(i, n);
|
|
1226
|
-
if (void 0 === s) return;
|
|
1227
|
-
let [r, a] = s;
|
|
1228
|
-
await this.file.ensureChunk(r, a);
|
|
1229
|
-
let o = 4 + this.file.getUint32(r);
|
|
1230
|
-
r += o, a -= o, await this.registerSegment("tiff", r, a);
|
|
1231
|
-
}
|
|
1232
|
-
findExifLocIdInIinf(e) {
|
|
1233
|
-
this.parseBoxFullHead(e);
|
|
1234
|
-
let t, i, n, s, r = e.start, a = this.file.getUint16(r);
|
|
1235
|
-
for (r += 2; a--;) {
|
|
1236
|
-
if (t = this.parseBoxHead(r), this.parseBoxFullHead(t), i = t.start, t.version >= 2 && (n = 3 === t.version ? 4 : 2, s = this.file.getString(i + n + 2, 4), "Exif" === s)) return this.file.getUintBytes(i, n);
|
|
1237
|
-
r += t.length;
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
get8bits(e) {
|
|
1241
|
-
let t = this.file.getUint8(e);
|
|
1242
|
-
return [t >> 4, 15 & t];
|
|
1243
|
-
}
|
|
1244
|
-
findExtentInIloc(e, t) {
|
|
1245
|
-
this.parseBoxFullHead(e);
|
|
1246
|
-
let i = e.start, [n, s] = this.get8bits(i++), [r, a] = this.get8bits(i++), o = 2 === e.version ? 4 : 2, l = 1 === e.version || 2 === e.version ? 2 : 0, h = a + n + s, u = 2 === e.version ? 4 : 2, c = this.file.getUintBytes(i, u);
|
|
1247
|
-
for (i += u; c--;) {
|
|
1248
|
-
let e = this.file.getUintBytes(i, o);
|
|
1249
|
-
i += o + l + 2 + r;
|
|
1250
|
-
let u = this.file.getUint16(i);
|
|
1251
|
-
if (i += 2, e === t) return u > 1 && console.warn("ILOC box has more than one extent but we're only processing one\nPlease create an issue at https://github.com/MikeKovarik/exifr with this file"), [this.file.getUintBytes(i + a, n), this.file.getUintBytes(i + a + n, s)];
|
|
1252
|
-
i += u * h;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
class He extends ze {}
|
|
1257
|
-
f(He, "type", "heic");
|
|
1258
|
-
class je extends ze {}
|
|
1259
|
-
f(je, "type", "avif"), T.set("heic", He), T.set("avif", je), B(N, ["ifd0", "ifd1"], [
|
|
1260
|
-
[256, "ImageWidth"],
|
|
1261
|
-
[257, "ImageHeight"],
|
|
1262
|
-
[258, "BitsPerSample"],
|
|
1263
|
-
[259, "Compression"],
|
|
1264
|
-
[262, "PhotometricInterpretation"],
|
|
1265
|
-
[270, "ImageDescription"],
|
|
1266
|
-
[271, "Make"],
|
|
1267
|
-
[272, "Model"],
|
|
1268
|
-
[273, "StripOffsets"],
|
|
1269
|
-
[274, "Orientation"],
|
|
1270
|
-
[277, "SamplesPerPixel"],
|
|
1271
|
-
[278, "RowsPerStrip"],
|
|
1272
|
-
[279, "StripByteCounts"],
|
|
1273
|
-
[282, "XResolution"],
|
|
1274
|
-
[283, "YResolution"],
|
|
1275
|
-
[284, "PlanarConfiguration"],
|
|
1276
|
-
[296, "ResolutionUnit"],
|
|
1277
|
-
[301, "TransferFunction"],
|
|
1278
|
-
[305, "Software"],
|
|
1279
|
-
[306, "ModifyDate"],
|
|
1280
|
-
[315, "Artist"],
|
|
1281
|
-
[316, "HostComputer"],
|
|
1282
|
-
[317, "Predictor"],
|
|
1283
|
-
[318, "WhitePoint"],
|
|
1284
|
-
[319, "PrimaryChromaticities"],
|
|
1285
|
-
[513, "ThumbnailOffset"],
|
|
1286
|
-
[514, "ThumbnailLength"],
|
|
1287
|
-
[529, "YCbCrCoefficients"],
|
|
1288
|
-
[530, "YCbCrSubSampling"],
|
|
1289
|
-
[531, "YCbCrPositioning"],
|
|
1290
|
-
[532, "ReferenceBlackWhite"],
|
|
1291
|
-
[700, "ApplicationNotes"],
|
|
1292
|
-
[33432, "Copyright"],
|
|
1293
|
-
[33723, "IPTC"],
|
|
1294
|
-
[34665, "ExifIFD"],
|
|
1295
|
-
[34675, "ICC"],
|
|
1296
|
-
[34853, "GpsIFD"],
|
|
1297
|
-
[330, "SubIFD"],
|
|
1298
|
-
[40965, "InteropIFD"],
|
|
1299
|
-
[40091, "XPTitle"],
|
|
1300
|
-
[40092, "XPComment"],
|
|
1301
|
-
[40093, "XPAuthor"],
|
|
1302
|
-
[40094, "XPKeywords"],
|
|
1303
|
-
[40095, "XPSubject"]
|
|
1304
|
-
]), B(N, "exif", [
|
|
1305
|
-
[33434, "ExposureTime"],
|
|
1306
|
-
[33437, "FNumber"],
|
|
1307
|
-
[34850, "ExposureProgram"],
|
|
1308
|
-
[34852, "SpectralSensitivity"],
|
|
1309
|
-
[34855, "ISO"],
|
|
1310
|
-
[34858, "TimeZoneOffset"],
|
|
1311
|
-
[34859, "SelfTimerMode"],
|
|
1312
|
-
[34864, "SensitivityType"],
|
|
1313
|
-
[34865, "StandardOutputSensitivity"],
|
|
1314
|
-
[34866, "RecommendedExposureIndex"],
|
|
1315
|
-
[34867, "ISOSpeed"],
|
|
1316
|
-
[34868, "ISOSpeedLatitudeyyy"],
|
|
1317
|
-
[34869, "ISOSpeedLatitudezzz"],
|
|
1318
|
-
[36864, "ExifVersion"],
|
|
1319
|
-
[36867, "DateTimeOriginal"],
|
|
1320
|
-
[36868, "CreateDate"],
|
|
1321
|
-
[36873, "GooglePlusUploadCode"],
|
|
1322
|
-
[36880, "OffsetTime"],
|
|
1323
|
-
[36881, "OffsetTimeOriginal"],
|
|
1324
|
-
[36882, "OffsetTimeDigitized"],
|
|
1325
|
-
[37121, "ComponentsConfiguration"],
|
|
1326
|
-
[37122, "CompressedBitsPerPixel"],
|
|
1327
|
-
[37377, "ShutterSpeedValue"],
|
|
1328
|
-
[37378, "ApertureValue"],
|
|
1329
|
-
[37379, "BrightnessValue"],
|
|
1330
|
-
[37380, "ExposureCompensation"],
|
|
1331
|
-
[37381, "MaxApertureValue"],
|
|
1332
|
-
[37382, "SubjectDistance"],
|
|
1333
|
-
[37383, "MeteringMode"],
|
|
1334
|
-
[37384, "LightSource"],
|
|
1335
|
-
[37385, "Flash"],
|
|
1336
|
-
[37386, "FocalLength"],
|
|
1337
|
-
[37393, "ImageNumber"],
|
|
1338
|
-
[37394, "SecurityClassification"],
|
|
1339
|
-
[37395, "ImageHistory"],
|
|
1340
|
-
[37396, "SubjectArea"],
|
|
1341
|
-
[37500, "MakerNote"],
|
|
1342
|
-
[37510, "UserComment"],
|
|
1343
|
-
[37520, "SubSecTime"],
|
|
1344
|
-
[37521, "SubSecTimeOriginal"],
|
|
1345
|
-
[37522, "SubSecTimeDigitized"],
|
|
1346
|
-
[37888, "AmbientTemperature"],
|
|
1347
|
-
[37889, "Humidity"],
|
|
1348
|
-
[37890, "Pressure"],
|
|
1349
|
-
[37891, "WaterDepth"],
|
|
1350
|
-
[37892, "Acceleration"],
|
|
1351
|
-
[37893, "CameraElevationAngle"],
|
|
1352
|
-
[40960, "FlashpixVersion"],
|
|
1353
|
-
[40961, "ColorSpace"],
|
|
1354
|
-
[40962, "ExifImageWidth"],
|
|
1355
|
-
[40963, "ExifImageHeight"],
|
|
1356
|
-
[40964, "RelatedSoundFile"],
|
|
1357
|
-
[41483, "FlashEnergy"],
|
|
1358
|
-
[41486, "FocalPlaneXResolution"],
|
|
1359
|
-
[41487, "FocalPlaneYResolution"],
|
|
1360
|
-
[41488, "FocalPlaneResolutionUnit"],
|
|
1361
|
-
[41492, "SubjectLocation"],
|
|
1362
|
-
[41493, "ExposureIndex"],
|
|
1363
|
-
[41495, "SensingMethod"],
|
|
1364
|
-
[41728, "FileSource"],
|
|
1365
|
-
[41729, "SceneType"],
|
|
1366
|
-
[41730, "CFAPattern"],
|
|
1367
|
-
[41985, "CustomRendered"],
|
|
1368
|
-
[41986, "ExposureMode"],
|
|
1369
|
-
[41987, "WhiteBalance"],
|
|
1370
|
-
[41988, "DigitalZoomRatio"],
|
|
1371
|
-
[41989, "FocalLengthIn35mmFormat"],
|
|
1372
|
-
[41990, "SceneCaptureType"],
|
|
1373
|
-
[41991, "GainControl"],
|
|
1374
|
-
[41992, "Contrast"],
|
|
1375
|
-
[41993, "Saturation"],
|
|
1376
|
-
[41994, "Sharpness"],
|
|
1377
|
-
[41996, "SubjectDistanceRange"],
|
|
1378
|
-
[42016, "ImageUniqueID"],
|
|
1379
|
-
[42032, "OwnerName"],
|
|
1380
|
-
[42033, "SerialNumber"],
|
|
1381
|
-
[42034, "LensInfo"],
|
|
1382
|
-
[42035, "LensMake"],
|
|
1383
|
-
[42036, "LensModel"],
|
|
1384
|
-
[42037, "LensSerialNumber"],
|
|
1385
|
-
[42080, "CompositeImage"],
|
|
1386
|
-
[42081, "CompositeImageCount"],
|
|
1387
|
-
[42082, "CompositeImageExposureTimes"],
|
|
1388
|
-
[42240, "Gamma"],
|
|
1389
|
-
[59932, "Padding"],
|
|
1390
|
-
[59933, "OffsetSchema"],
|
|
1391
|
-
[65e3, "OwnerName"],
|
|
1392
|
-
[65001, "SerialNumber"],
|
|
1393
|
-
[65002, "Lens"],
|
|
1394
|
-
[65100, "RawFile"],
|
|
1395
|
-
[65101, "Converter"],
|
|
1396
|
-
[65102, "WhiteBalance"],
|
|
1397
|
-
[65105, "Exposure"],
|
|
1398
|
-
[65106, "Shadows"],
|
|
1399
|
-
[65107, "Brightness"],
|
|
1400
|
-
[65108, "Contrast"],
|
|
1401
|
-
[65109, "Saturation"],
|
|
1402
|
-
[65110, "Sharpness"],
|
|
1403
|
-
[65111, "Smoothness"],
|
|
1404
|
-
[65112, "MoireFilter"],
|
|
1405
|
-
[40965, "InteropIFD"]
|
|
1406
|
-
]), B(N, "gps", [
|
|
1407
|
-
[0, "GPSVersionID"],
|
|
1408
|
-
[1, "GPSLatitudeRef"],
|
|
1409
|
-
[2, "GPSLatitude"],
|
|
1410
|
-
[3, "GPSLongitudeRef"],
|
|
1411
|
-
[4, "GPSLongitude"],
|
|
1412
|
-
[5, "GPSAltitudeRef"],
|
|
1413
|
-
[6, "GPSAltitude"],
|
|
1414
|
-
[7, "GPSTimeStamp"],
|
|
1415
|
-
[8, "GPSSatellites"],
|
|
1416
|
-
[9, "GPSStatus"],
|
|
1417
|
-
[10, "GPSMeasureMode"],
|
|
1418
|
-
[11, "GPSDOP"],
|
|
1419
|
-
[12, "GPSSpeedRef"],
|
|
1420
|
-
[13, "GPSSpeed"],
|
|
1421
|
-
[14, "GPSTrackRef"],
|
|
1422
|
-
[15, "GPSTrack"],
|
|
1423
|
-
[16, "GPSImgDirectionRef"],
|
|
1424
|
-
[17, "GPSImgDirection"],
|
|
1425
|
-
[18, "GPSMapDatum"],
|
|
1426
|
-
[19, "GPSDestLatitudeRef"],
|
|
1427
|
-
[20, "GPSDestLatitude"],
|
|
1428
|
-
[21, "GPSDestLongitudeRef"],
|
|
1429
|
-
[22, "GPSDestLongitude"],
|
|
1430
|
-
[23, "GPSDestBearingRef"],
|
|
1431
|
-
[24, "GPSDestBearing"],
|
|
1432
|
-
[25, "GPSDestDistanceRef"],
|
|
1433
|
-
[26, "GPSDestDistance"],
|
|
1434
|
-
[27, "GPSProcessingMethod"],
|
|
1435
|
-
[28, "GPSAreaInformation"],
|
|
1436
|
-
[29, "GPSDateStamp"],
|
|
1437
|
-
[30, "GPSDifferential"],
|
|
1438
|
-
[31, "GPSHPositioningError"]
|
|
1439
|
-
]), B(G, ["ifd0", "ifd1"], [[274, {
|
|
1440
|
-
1: "Horizontal (normal)",
|
|
1441
|
-
2: "Mirror horizontal",
|
|
1442
|
-
3: "Rotate 180",
|
|
1443
|
-
4: "Mirror vertical",
|
|
1444
|
-
5: "Mirror horizontal and rotate 270 CW",
|
|
1445
|
-
6: "Rotate 90 CW",
|
|
1446
|
-
7: "Mirror horizontal and rotate 90 CW",
|
|
1447
|
-
8: "Rotate 270 CW"
|
|
1448
|
-
}], [296, {
|
|
1449
|
-
1: "None",
|
|
1450
|
-
2: "inches",
|
|
1451
|
-
3: "cm"
|
|
1452
|
-
}]]);
|
|
1453
|
-
let We = B(G, "exif", [
|
|
1454
|
-
[34850, {
|
|
1455
|
-
0: "Not defined",
|
|
1456
|
-
1: "Manual",
|
|
1457
|
-
2: "Normal program",
|
|
1458
|
-
3: "Aperture priority",
|
|
1459
|
-
4: "Shutter priority",
|
|
1460
|
-
5: "Creative program",
|
|
1461
|
-
6: "Action program",
|
|
1462
|
-
7: "Portrait mode",
|
|
1463
|
-
8: "Landscape mode"
|
|
1464
|
-
}],
|
|
1465
|
-
[37121, {
|
|
1466
|
-
0: "-",
|
|
1467
|
-
1: "Y",
|
|
1468
|
-
2: "Cb",
|
|
1469
|
-
3: "Cr",
|
|
1470
|
-
4: "R",
|
|
1471
|
-
5: "G",
|
|
1472
|
-
6: "B"
|
|
1473
|
-
}],
|
|
1474
|
-
[37383, {
|
|
1475
|
-
0: "Unknown",
|
|
1476
|
-
1: "Average",
|
|
1477
|
-
2: "CenterWeightedAverage",
|
|
1478
|
-
3: "Spot",
|
|
1479
|
-
4: "MultiSpot",
|
|
1480
|
-
5: "Pattern",
|
|
1481
|
-
6: "Partial",
|
|
1482
|
-
255: "Other"
|
|
1483
|
-
}],
|
|
1484
|
-
[37384, {
|
|
1485
|
-
0: "Unknown",
|
|
1486
|
-
1: "Daylight",
|
|
1487
|
-
2: "Fluorescent",
|
|
1488
|
-
3: "Tungsten (incandescent light)",
|
|
1489
|
-
4: "Flash",
|
|
1490
|
-
9: "Fine weather",
|
|
1491
|
-
10: "Cloudy weather",
|
|
1492
|
-
11: "Shade",
|
|
1493
|
-
12: "Daylight fluorescent (D 5700 - 7100K)",
|
|
1494
|
-
13: "Day white fluorescent (N 4600 - 5400K)",
|
|
1495
|
-
14: "Cool white fluorescent (W 3900 - 4500K)",
|
|
1496
|
-
15: "White fluorescent (WW 3200 - 3700K)",
|
|
1497
|
-
17: "Standard light A",
|
|
1498
|
-
18: "Standard light B",
|
|
1499
|
-
19: "Standard light C",
|
|
1500
|
-
20: "D55",
|
|
1501
|
-
21: "D65",
|
|
1502
|
-
22: "D75",
|
|
1503
|
-
23: "D50",
|
|
1504
|
-
24: "ISO studio tungsten",
|
|
1505
|
-
255: "Other"
|
|
1506
|
-
}],
|
|
1507
|
-
[37385, {
|
|
1508
|
-
0: "Flash did not fire",
|
|
1509
|
-
1: "Flash fired",
|
|
1510
|
-
5: "Strobe return light not detected",
|
|
1511
|
-
7: "Strobe return light detected",
|
|
1512
|
-
9: "Flash fired, compulsory flash mode",
|
|
1513
|
-
13: "Flash fired, compulsory flash mode, return light not detected",
|
|
1514
|
-
15: "Flash fired, compulsory flash mode, return light detected",
|
|
1515
|
-
16: "Flash did not fire, compulsory flash mode",
|
|
1516
|
-
24: "Flash did not fire, auto mode",
|
|
1517
|
-
25: "Flash fired, auto mode",
|
|
1518
|
-
29: "Flash fired, auto mode, return light not detected",
|
|
1519
|
-
31: "Flash fired, auto mode, return light detected",
|
|
1520
|
-
32: "No flash function",
|
|
1521
|
-
65: "Flash fired, red-eye reduction mode",
|
|
1522
|
-
69: "Flash fired, red-eye reduction mode, return light not detected",
|
|
1523
|
-
71: "Flash fired, red-eye reduction mode, return light detected",
|
|
1524
|
-
73: "Flash fired, compulsory flash mode, red-eye reduction mode",
|
|
1525
|
-
77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
|
|
1526
|
-
79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
|
|
1527
|
-
89: "Flash fired, auto mode, red-eye reduction mode",
|
|
1528
|
-
93: "Flash fired, auto mode, return light not detected, red-eye reduction mode",
|
|
1529
|
-
95: "Flash fired, auto mode, return light detected, red-eye reduction mode"
|
|
1530
|
-
}],
|
|
1531
|
-
[41495, {
|
|
1532
|
-
1: "Not defined",
|
|
1533
|
-
2: "One-chip color area sensor",
|
|
1534
|
-
3: "Two-chip color area sensor",
|
|
1535
|
-
4: "Three-chip color area sensor",
|
|
1536
|
-
5: "Color sequential area sensor",
|
|
1537
|
-
7: "Trilinear sensor",
|
|
1538
|
-
8: "Color sequential linear sensor"
|
|
1539
|
-
}],
|
|
1540
|
-
[41728, {
|
|
1541
|
-
1: "Film Scanner",
|
|
1542
|
-
2: "Reflection Print Scanner",
|
|
1543
|
-
3: "Digital Camera"
|
|
1544
|
-
}],
|
|
1545
|
-
[41729, { 1: "Directly photographed" }],
|
|
1546
|
-
[41985, {
|
|
1547
|
-
0: "Normal",
|
|
1548
|
-
1: "Custom",
|
|
1549
|
-
2: "HDR (no original saved)",
|
|
1550
|
-
3: "HDR (original saved)",
|
|
1551
|
-
4: "Original (for HDR)",
|
|
1552
|
-
6: "Panorama",
|
|
1553
|
-
7: "Portrait HDR",
|
|
1554
|
-
8: "Portrait"
|
|
1555
|
-
}],
|
|
1556
|
-
[41986, {
|
|
1557
|
-
0: "Auto",
|
|
1558
|
-
1: "Manual",
|
|
1559
|
-
2: "Auto bracket"
|
|
1560
|
-
}],
|
|
1561
|
-
[41987, {
|
|
1562
|
-
0: "Auto",
|
|
1563
|
-
1: "Manual"
|
|
1564
|
-
}],
|
|
1565
|
-
[41990, {
|
|
1566
|
-
0: "Standard",
|
|
1567
|
-
1: "Landscape",
|
|
1568
|
-
2: "Portrait",
|
|
1569
|
-
3: "Night",
|
|
1570
|
-
4: "Other"
|
|
1571
|
-
}],
|
|
1572
|
-
[41991, {
|
|
1573
|
-
0: "None",
|
|
1574
|
-
1: "Low gain up",
|
|
1575
|
-
2: "High gain up",
|
|
1576
|
-
3: "Low gain down",
|
|
1577
|
-
4: "High gain down"
|
|
1578
|
-
}],
|
|
1579
|
-
[41996, {
|
|
1580
|
-
0: "Unknown",
|
|
1581
|
-
1: "Macro",
|
|
1582
|
-
2: "Close",
|
|
1583
|
-
3: "Distant"
|
|
1584
|
-
}],
|
|
1585
|
-
[42080, {
|
|
1586
|
-
0: "Unknown",
|
|
1587
|
-
1: "Not a Composite Image",
|
|
1588
|
-
2: "General Composite Image",
|
|
1589
|
-
3: "Composite Image Captured While Shooting"
|
|
1590
|
-
}]
|
|
1591
|
-
]);
|
|
1592
|
-
const Ke = {
|
|
1593
|
-
1: "No absolute unit of measurement",
|
|
1594
|
-
2: "Inch",
|
|
1595
|
-
3: "Centimeter"
|
|
1596
|
-
};
|
|
1597
|
-
We.set(37392, Ke), We.set(41488, Ke);
|
|
1598
|
-
const Xe = {
|
|
1599
|
-
0: "Normal",
|
|
1600
|
-
1: "Low",
|
|
1601
|
-
2: "High"
|
|
1602
|
-
};
|
|
1603
|
-
function _e(e) {
|
|
1604
|
-
return "object" == typeof e && void 0 !== e.length ? e[0] : e;
|
|
1605
|
-
}
|
|
1606
|
-
function Ye(e) {
|
|
1607
|
-
let t = Array.from(e).slice(1);
|
|
1608
|
-
return t[1] > 15 && (t = t.map(((e) => String.fromCharCode(e)))), "0" !== t[2] && 0 !== t[2] || t.pop(), t.join(".");
|
|
1609
|
-
}
|
|
1610
|
-
function $e(e) {
|
|
1611
|
-
if ("string" == typeof e) {
|
|
1612
|
-
var [t, i, n, s, r, a] = e.trim().split(/[-: ]/g).map(Number), o = new Date(t, i - 1, n);
|
|
1613
|
-
return Number.isNaN(s) || Number.isNaN(r) || Number.isNaN(a) || (o.setHours(s), o.setMinutes(r), o.setSeconds(a)), Number.isNaN(+o) ? e : o;
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
function Je(e) {
|
|
1617
|
-
if ("string" == typeof e) return e;
|
|
1618
|
-
let t = [];
|
|
1619
|
-
if (0 === e[1] && 0 === e[e.length - 1]) for (let i = 0; i < e.length; i += 2) t.push(qe(e[i + 1], e[i]));
|
|
1620
|
-
else for (let i = 0; i < e.length; i += 2) t.push(qe(e[i], e[i + 1]));
|
|
1621
|
-
return S(String.fromCodePoint(...t));
|
|
1622
|
-
}
|
|
1623
|
-
function qe(e, t) {
|
|
1624
|
-
return e << 8 | t;
|
|
1625
|
-
}
|
|
1626
|
-
We.set(41992, Xe), We.set(41993, Xe), We.set(41994, Xe), B(V, ["ifd0", "ifd1"], [
|
|
1627
|
-
[50827, function(e) {
|
|
1628
|
-
return "string" != typeof e ? P(e) : e;
|
|
1629
|
-
}],
|
|
1630
|
-
[306, $e],
|
|
1631
|
-
[40091, Je],
|
|
1632
|
-
[40092, Je],
|
|
1633
|
-
[40093, Je],
|
|
1634
|
-
[40094, Je],
|
|
1635
|
-
[40095, Je]
|
|
1636
|
-
]), B(V, "exif", [
|
|
1637
|
-
[40960, Ye],
|
|
1638
|
-
[36864, Ye],
|
|
1639
|
-
[36867, $e],
|
|
1640
|
-
[36868, $e],
|
|
1641
|
-
[40962, _e],
|
|
1642
|
-
[40963, _e]
|
|
1643
|
-
]), B(V, "gps", [[0, (e) => Array.from(e).join(".")], [7, (e) => Array.from(e).join(":")]]);
|
|
1644
|
-
const Qe = "http://ns.adobe.com/", Ze = "http://ns.adobe.com/xmp/extension/";
|
|
1645
|
-
class et extends ge {
|
|
1646
|
-
static canHandle(e, t) {
|
|
1647
|
-
return 225 === e.getUint8(t + 1) && 1752462448 === e.getUint32(t + 4) && e.getString(t + 4, 20) === Qe;
|
|
1648
|
-
}
|
|
1649
|
-
static headerLength(e, t) {
|
|
1650
|
-
return e.getString(t + 4, 34) === Ze ? 79 : 33;
|
|
1651
|
-
}
|
|
1652
|
-
static findPosition(e, t) {
|
|
1653
|
-
let i = super.findPosition(e, t);
|
|
1654
|
-
return i.multiSegment = i.extended = 79 === i.headerLength, i.multiSegment ? (i.chunkCount = e.getUint8(t + 72), i.chunkNumber = e.getUint8(t + 76), 0 !== e.getUint8(t + 77) && i.chunkNumber++) : (i.chunkCount = Infinity, i.chunkNumber = -1), i;
|
|
1655
|
-
}
|
|
1656
|
-
static handleMultiSegments(e) {
|
|
1657
|
-
return e.map(((e) => e.chunk.getString())).join("");
|
|
1658
|
-
}
|
|
1659
|
-
normalizeInput(e) {
|
|
1660
|
-
return "string" == typeof e ? e : I.from(e).getString();
|
|
1661
|
-
}
|
|
1662
|
-
parse(e = this.chunk) {
|
|
1663
|
-
if (!this.localOptions.parse) return e;
|
|
1664
|
-
e = function(e) {
|
|
1665
|
-
let t = {}, i = {};
|
|
1666
|
-
for (let e of ut) t[e] = [], i[e] = 0;
|
|
1667
|
-
return e.replace(ct, ((e, n, s) => {
|
|
1668
|
-
if ("<" === n) {
|
|
1669
|
-
let n = ++i[s];
|
|
1670
|
-
return t[s].push(n), `${e}#${n}`;
|
|
1671
|
-
}
|
|
1672
|
-
return `${e}#${t[s].pop()}`;
|
|
1673
|
-
}));
|
|
1674
|
-
}(e);
|
|
1675
|
-
let t = nt.findAll(e, "rdf", "Description");
|
|
1676
|
-
0 === t.length && t.push(new nt("rdf", "Description", void 0, e));
|
|
1677
|
-
let i, n = {};
|
|
1678
|
-
for (let e of t) for (let t of e.properties) i = ot(t.ns, n), st(t, i);
|
|
1679
|
-
return function(e) {
|
|
1680
|
-
let t;
|
|
1681
|
-
for (let i in e) t = e[i] = d(e[i]), void 0 === t && delete e[i];
|
|
1682
|
-
return d(e);
|
|
1683
|
-
}(n);
|
|
1684
|
-
}
|
|
1685
|
-
assignToOutput(e, t) {
|
|
1686
|
-
if (this.localOptions.parse) for (let [i, n] of Object.entries(t)) switch (i) {
|
|
1687
|
-
case "tiff":
|
|
1688
|
-
this.assignObjectToOutput(e, "ifd0", n);
|
|
1689
|
-
break;
|
|
1690
|
-
case "exif":
|
|
1691
|
-
this.assignObjectToOutput(e, "exif", n);
|
|
1692
|
-
break;
|
|
1693
|
-
case "xmlns": break;
|
|
1694
|
-
default: this.assignObjectToOutput(e, i, n);
|
|
1695
|
-
}
|
|
1696
|
-
else e.xmp = t;
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
f(et, "type", "xmp"), f(et, "multiSegment", !0), A.set("xmp", et);
|
|
1700
|
-
class tt {
|
|
1701
|
-
static findAll(e) {
|
|
1702
|
-
return lt(e, /([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(tt.unpackMatch);
|
|
1703
|
-
}
|
|
1704
|
-
static unpackMatch(e) {
|
|
1705
|
-
let t = e[1], i = e[2], n = e[3].slice(1, -1);
|
|
1706
|
-
return n = ht(n), new tt(t, i, n);
|
|
1707
|
-
}
|
|
1708
|
-
constructor(e, t, i) {
|
|
1709
|
-
this.ns = e, this.name = t, this.value = i;
|
|
1710
|
-
}
|
|
1711
|
-
serialize() {
|
|
1712
|
-
return this.value;
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
const it = "[\\w\\d-]+";
|
|
1716
|
-
class nt {
|
|
1717
|
-
static findAll(e, t, i) {
|
|
1718
|
-
if (void 0 !== t || void 0 !== i) {
|
|
1719
|
-
t = t || it, i = i || it;
|
|
1720
|
-
var n = new RegExp(`<(${t}):(${i})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`, "gm");
|
|
1721
|
-
} else n = /<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;
|
|
1722
|
-
return lt(e, n).map(nt.unpackMatch);
|
|
1723
|
-
}
|
|
1724
|
-
static unpackMatch(e) {
|
|
1725
|
-
let t = e[1], i = e[2], n = e[4], s = e[8];
|
|
1726
|
-
return new nt(t, i, n, s);
|
|
1727
|
-
}
|
|
1728
|
-
constructor(e, t, i, n) {
|
|
1729
|
-
this.ns = e, this.name = t, this.attrString = i, this.innerXml = n, this.attrs = tt.findAll(i), this.children = nt.findAll(n), this.value = 0 === this.children.length ? ht(n) : void 0, this.properties = [...this.attrs, ...this.children];
|
|
1730
|
-
}
|
|
1731
|
-
get isPrimitive() {
|
|
1732
|
-
return void 0 !== this.value && 0 === this.attrs.length && 0 === this.children.length;
|
|
1733
|
-
}
|
|
1734
|
-
get isListContainer() {
|
|
1735
|
-
return 1 === this.children.length && this.children[0].isList;
|
|
1736
|
-
}
|
|
1737
|
-
get isList() {
|
|
1738
|
-
let { ns: e, name: t } = this;
|
|
1739
|
-
return "rdf" === e && ("Seq" === t || "Bag" === t || "Alt" === t);
|
|
1740
|
-
}
|
|
1741
|
-
get isListItem() {
|
|
1742
|
-
return "rdf" === this.ns && "li" === this.name;
|
|
1743
|
-
}
|
|
1744
|
-
serialize() {
|
|
1745
|
-
if (0 === this.properties.length && void 0 === this.value) return;
|
|
1746
|
-
if (this.isPrimitive) return this.value;
|
|
1747
|
-
if (this.isListContainer) return this.children[0].serialize();
|
|
1748
|
-
if (this.isList) return at(this.children.map(rt));
|
|
1749
|
-
if (this.isListItem && 1 === this.children.length && 0 === this.attrs.length) return this.children[0].serialize();
|
|
1750
|
-
let e = {};
|
|
1751
|
-
for (let t of this.properties) st(t, e);
|
|
1752
|
-
return void 0 !== this.value && (e.value = this.value), d(e);
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
function st(e, t) {
|
|
1756
|
-
let i = e.serialize();
|
|
1757
|
-
void 0 !== i && (t[e.name] = i);
|
|
1758
|
-
}
|
|
1759
|
-
var rt = (e) => e.serialize(), at = (e) => 1 === e.length ? e[0] : e, ot = (e, t) => t[e] ? t[e] : t[e] = {};
|
|
1760
|
-
function lt(e, t) {
|
|
1761
|
-
let i, n = [];
|
|
1762
|
-
if (!e) return n;
|
|
1763
|
-
for (; null !== (i = t.exec(e));) n.push(i);
|
|
1764
|
-
return n;
|
|
1765
|
-
}
|
|
1766
|
-
function ht(e) {
|
|
1767
|
-
if (function(e) {
|
|
1768
|
-
return null == e || "null" === e || "undefined" === e || "" === e || "" === e.trim();
|
|
1769
|
-
}(e)) return;
|
|
1770
|
-
let t = Number(e);
|
|
1771
|
-
if (!Number.isNaN(t)) return t;
|
|
1772
|
-
let i = e.toLowerCase();
|
|
1773
|
-
return "true" === i || "false" !== i && e.trim();
|
|
1774
|
-
}
|
|
1775
|
-
const ut = [
|
|
1776
|
-
"rdf:li",
|
|
1777
|
-
"rdf:Seq",
|
|
1778
|
-
"rdf:Bag",
|
|
1779
|
-
"rdf:Alt",
|
|
1780
|
-
"rdf:Description"
|
|
1781
|
-
], ct = new RegExp(`(<|\\/)(${ut.join("|")})`, "g");
|
|
1782
|
-
var ft = Object.freeze({
|
|
1783
|
-
__proto__: null,
|
|
1784
|
-
default: Ge,
|
|
1785
|
-
Exifr: ce,
|
|
1786
|
-
fileParsers: T,
|
|
1787
|
-
segmentParsers: A,
|
|
1788
|
-
fileReaders: D,
|
|
1789
|
-
tagKeys: N,
|
|
1790
|
-
tagValues: G,
|
|
1791
|
-
tagRevivers: V,
|
|
1792
|
-
createDictionary: B,
|
|
1793
|
-
extendDictionary: E,
|
|
1794
|
-
fetchUrlAsArrayBuffer: L,
|
|
1795
|
-
readBlobAsArrayBuffer: U,
|
|
1796
|
-
chunkedProps: $,
|
|
1797
|
-
otherSegments: J,
|
|
1798
|
-
segments: q,
|
|
1799
|
-
tiffBlocks: Q,
|
|
1800
|
-
segmentsAndBlocks: Z,
|
|
1801
|
-
tiffExtractables: ee,
|
|
1802
|
-
inheritables: te,
|
|
1803
|
-
allFormatters: ie,
|
|
1804
|
-
Options: oe,
|
|
1805
|
-
parse: fe,
|
|
1806
|
-
gpsOnlyOptions: Ae,
|
|
1807
|
-
gps: De,
|
|
1808
|
-
thumbnailOnlyOptions: Oe,
|
|
1809
|
-
thumbnail: xe,
|
|
1810
|
-
thumbnailUrl: ve,
|
|
1811
|
-
orientationOnlyOptions: Me,
|
|
1812
|
-
orientation: Re,
|
|
1813
|
-
rotations: Le,
|
|
1814
|
-
get rotateCanvas() {
|
|
1815
|
-
return e.rotateCanvas;
|
|
1816
|
-
},
|
|
1817
|
-
get rotateCss() {
|
|
1818
|
-
return e.rotateCss;
|
|
1819
|
-
},
|
|
1820
|
-
rotation: Ue
|
|
1821
|
-
});
|
|
1822
|
-
const dt = [
|
|
1823
|
-
"xmp",
|
|
1824
|
-
"icc",
|
|
1825
|
-
"iptc",
|
|
1826
|
-
"tiff"
|
|
1827
|
-
], pt = () => {};
|
|
1828
|
-
async function gt(e, t, i) {
|
|
1829
|
-
let n = i[e];
|
|
1830
|
-
return n.enabled = !0, n.parse = !0, A.get(e).parse(t, n);
|
|
1831
|
-
}
|
|
1832
|
-
let mt = h("fs", ((e) => e.promises));
|
|
1833
|
-
D.set("fs", class extends Ne {
|
|
1834
|
-
async readWhole() {
|
|
1835
|
-
this.chunked = !1, this.fs = await mt;
|
|
1836
|
-
let e = await this.fs.readFile(this.input);
|
|
1837
|
-
this._swapBuffer(e);
|
|
1838
|
-
}
|
|
1839
|
-
async readChunked() {
|
|
1840
|
-
this.chunked = !0, this.fs = await mt, await this.open(), await this.readChunk(0, this.options.firstChunkSize);
|
|
1841
|
-
}
|
|
1842
|
-
async open() {
|
|
1843
|
-
void 0 === this.fh && (this.fh = await this.fs.open(this.input, "r"), this.size = (await this.fh.stat(this.input)).size);
|
|
1844
|
-
}
|
|
1845
|
-
async _readChunk(e, t) {
|
|
1846
|
-
void 0 === this.fh && await this.open(), e + t > this.size && (t = this.size - e);
|
|
1847
|
-
var i = this.subarray(e, t, !0);
|
|
1848
|
-
return await this.fh.read(i.dataView, 0, t, e), i;
|
|
1849
|
-
}
|
|
1850
|
-
async close() {
|
|
1851
|
-
if (this.fh) {
|
|
1852
|
-
let e = this.fh;
|
|
1853
|
-
this.fh = void 0, await e.close();
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
});
|
|
1857
|
-
D.set("base64", class extends Ne {
|
|
1858
|
-
constructor(...e) {
|
|
1859
|
-
super(...e), this.input = this.input.replace(/^data:([^;]+);base64,/gim, ""), this.size = this.input.length / 4 * 3, this.input.endsWith("==") ? this.size -= 2 : this.input.endsWith("=") && (this.size -= 1);
|
|
1860
|
-
}
|
|
1861
|
-
async _readChunk(e, t) {
|
|
1862
|
-
let i, n, s = this.input;
|
|
1863
|
-
void 0 === e ? (e = 0, i = 0, n = 0) : (i = 4 * Math.floor(e / 3), n = e - i / 4 * 3), void 0 === t && (t = this.size);
|
|
1864
|
-
let a = e + t, l = i + 4 * Math.ceil(a / 3);
|
|
1865
|
-
s = s.slice(i, l);
|
|
1866
|
-
let h = Math.min(t, this.size - e);
|
|
1867
|
-
if (o) {
|
|
1868
|
-
let t = r.from(s, "base64").slice(n, n + h);
|
|
1869
|
-
return this.set(t, e, !0);
|
|
1870
|
-
}
|
|
1871
|
-
{
|
|
1872
|
-
let t = this.subarray(e, h, !0), i = atob(s), r = t.toUint8();
|
|
1873
|
-
for (let e = 0; e < h; e++) r[e] = i.charCodeAt(n + e);
|
|
1874
|
-
return t;
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
});
|
|
1878
|
-
class St extends pe {
|
|
1879
|
-
static canHandle(e, t) {
|
|
1880
|
-
return 18761 === t || 19789 === t;
|
|
1881
|
-
}
|
|
1882
|
-
extendOptions(e) {
|
|
1883
|
-
let { ifd0: t, xmp: i, iptc: n, icc: s } = e;
|
|
1884
|
-
i.enabled && t.deps.add(j), n.enabled && t.deps.add(W), s.enabled && t.deps.add(K), t.finalizeFilters();
|
|
1885
|
-
}
|
|
1886
|
-
async parse() {
|
|
1887
|
-
let { tiff: e, xmp: t, iptc: i, icc: n } = this.options;
|
|
1888
|
-
if (e.enabled || t.enabled || i.enabled || n.enabled) {
|
|
1889
|
-
let e = Math.max(C(this.options), this.options.chunkSize);
|
|
1890
|
-
await this.file.ensureChunk(0, e), this.createParser("tiff", this.file), this.parsers.tiff.parseHeader(), await this.parsers.tiff.parseIfd0Block(), this.adaptTiffPropAsSegment("xmp"), this.adaptTiffPropAsSegment("iptc"), this.adaptTiffPropAsSegment("icc");
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
adaptTiffPropAsSegment(e) {
|
|
1894
|
-
if (this.parsers.tiff[e]) {
|
|
1895
|
-
let t = this.parsers.tiff[e];
|
|
1896
|
-
this.injectSegment(e, t);
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
f(St, "type", "tiff"), T.set("tiff", St);
|
|
1901
|
-
let Ct = h("zlib");
|
|
1902
|
-
const yt = "XML:com.adobe.xmp", bt = "ihdr", Pt = "iccp", It = "text", kt = "itxt", wt = [
|
|
1903
|
-
bt,
|
|
1904
|
-
Pt,
|
|
1905
|
-
It,
|
|
1906
|
-
kt,
|
|
1907
|
-
"exif"
|
|
1908
|
-
];
|
|
1909
|
-
class Tt extends pe {
|
|
1910
|
-
constructor(...e) {
|
|
1911
|
-
super(...e), f(this, "catchError", ((e) => this.errors.push(e))), f(this, "metaChunks", []), f(this, "unknownChunks", []);
|
|
1912
|
-
}
|
|
1913
|
-
static canHandle(e, t) {
|
|
1914
|
-
return 35152 === t && 2303741511 === e.getUint32(0) && 218765834 === e.getUint32(4);
|
|
1915
|
-
}
|
|
1916
|
-
async parse() {
|
|
1917
|
-
let { file: e } = this;
|
|
1918
|
-
await this.findPngChunksInRange(8, e.byteLength), await this.readSegments(this.metaChunks), this.findIhdr(), this.parseTextChunks(), await this.findExif().catch(this.catchError), await this.findXmp().catch(this.catchError), await this.findIcc().catch(this.catchError);
|
|
1919
|
-
}
|
|
1920
|
-
async findPngChunksInRange(e, t) {
|
|
1921
|
-
let { file: i } = this;
|
|
1922
|
-
for (; e < t;) {
|
|
1923
|
-
let t = i.getUint32(e), n = i.getUint32(e + 4), s = i.getString(e + 4, 4).toLowerCase(), r = t + 4 + 4 + 4, a = {
|
|
1924
|
-
type: s,
|
|
1925
|
-
offset: e,
|
|
1926
|
-
length: r,
|
|
1927
|
-
start: e + 4 + 4,
|
|
1928
|
-
size: t,
|
|
1929
|
-
marker: n
|
|
1930
|
-
};
|
|
1931
|
-
wt.includes(s) ? this.metaChunks.push(a) : this.unknownChunks.push(a), e += r;
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
parseTextChunks() {
|
|
1935
|
-
let e = this.metaChunks.filter(((e) => e.type === It));
|
|
1936
|
-
for (let t of e) {
|
|
1937
|
-
let [e, i] = this.file.getString(t.start, t.size).split("\0");
|
|
1938
|
-
this.injectKeyValToIhdr(e, i);
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
injectKeyValToIhdr(e, t) {
|
|
1942
|
-
let i = this.parsers.ihdr;
|
|
1943
|
-
i && i.raw.set(e, t);
|
|
1944
|
-
}
|
|
1945
|
-
findIhdr() {
|
|
1946
|
-
let e = this.metaChunks.find(((e) => e.type === bt));
|
|
1947
|
-
e && !1 !== this.options.ihdr.enabled && this.createParser(bt, e.chunk);
|
|
1948
|
-
}
|
|
1949
|
-
async findExif() {
|
|
1950
|
-
let e = this.metaChunks.find(((e) => "exif" === e.type));
|
|
1951
|
-
e && this.injectSegment("tiff", e.chunk);
|
|
1952
|
-
}
|
|
1953
|
-
async findXmp() {
|
|
1954
|
-
let e = this.metaChunks.filter(((e) => e.type === kt));
|
|
1955
|
-
for (let t of e) t.chunk.getString(0, 17) === yt && this.injectSegment("xmp", t.chunk);
|
|
1956
|
-
}
|
|
1957
|
-
async findIcc() {
|
|
1958
|
-
let e = this.metaChunks.find(((e) => e.type === Pt));
|
|
1959
|
-
if (!e) return;
|
|
1960
|
-
let { chunk: t } = e, i = t.getUint8Array(0, 81), n = 0;
|
|
1961
|
-
for (; n < 80 && 0 !== i[n];) n++;
|
|
1962
|
-
let r = n + 2, a = t.getString(0, n);
|
|
1963
|
-
if (this.injectKeyValToIhdr("ProfileName", a), s) {
|
|
1964
|
-
let e = await Ct, i = t.getUint8Array(r);
|
|
1965
|
-
i = e.inflateSync(i), this.injectSegment("icc", i);
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
f(Tt, "type", "png"), T.set("png", Tt), B(N, "interop", [
|
|
1970
|
-
[1, "InteropIndex"],
|
|
1971
|
-
[2, "InteropVersion"],
|
|
1972
|
-
[4096, "RelatedImageFileFormat"],
|
|
1973
|
-
[4097, "RelatedImageWidth"],
|
|
1974
|
-
[4098, "RelatedImageHeight"]
|
|
1975
|
-
]), E(N, "ifd0", [
|
|
1976
|
-
[11, "ProcessingSoftware"],
|
|
1977
|
-
[254, "SubfileType"],
|
|
1978
|
-
[255, "OldSubfileType"],
|
|
1979
|
-
[263, "Thresholding"],
|
|
1980
|
-
[264, "CellWidth"],
|
|
1981
|
-
[265, "CellLength"],
|
|
1982
|
-
[266, "FillOrder"],
|
|
1983
|
-
[269, "DocumentName"],
|
|
1984
|
-
[280, "MinSampleValue"],
|
|
1985
|
-
[281, "MaxSampleValue"],
|
|
1986
|
-
[285, "PageName"],
|
|
1987
|
-
[286, "XPosition"],
|
|
1988
|
-
[287, "YPosition"],
|
|
1989
|
-
[290, "GrayResponseUnit"],
|
|
1990
|
-
[297, "PageNumber"],
|
|
1991
|
-
[321, "HalftoneHints"],
|
|
1992
|
-
[322, "TileWidth"],
|
|
1993
|
-
[323, "TileLength"],
|
|
1994
|
-
[332, "InkSet"],
|
|
1995
|
-
[337, "TargetPrinter"],
|
|
1996
|
-
[18246, "Rating"],
|
|
1997
|
-
[18249, "RatingPercent"],
|
|
1998
|
-
[33550, "PixelScale"],
|
|
1999
|
-
[34264, "ModelTransform"],
|
|
2000
|
-
[34377, "PhotoshopSettings"],
|
|
2001
|
-
[50706, "DNGVersion"],
|
|
2002
|
-
[50707, "DNGBackwardVersion"],
|
|
2003
|
-
[50708, "UniqueCameraModel"],
|
|
2004
|
-
[50709, "LocalizedCameraModel"],
|
|
2005
|
-
[50736, "DNGLensInfo"],
|
|
2006
|
-
[50739, "ShadowScale"],
|
|
2007
|
-
[50740, "DNGPrivateData"],
|
|
2008
|
-
[33920, "IntergraphMatrix"],
|
|
2009
|
-
[33922, "ModelTiePoint"],
|
|
2010
|
-
[34118, "SEMInfo"],
|
|
2011
|
-
[34735, "GeoTiffDirectory"],
|
|
2012
|
-
[34736, "GeoTiffDoubleParams"],
|
|
2013
|
-
[34737, "GeoTiffAsciiParams"],
|
|
2014
|
-
[50341, "PrintIM"],
|
|
2015
|
-
[50721, "ColorMatrix1"],
|
|
2016
|
-
[50722, "ColorMatrix2"],
|
|
2017
|
-
[50723, "CameraCalibration1"],
|
|
2018
|
-
[50724, "CameraCalibration2"],
|
|
2019
|
-
[50725, "ReductionMatrix1"],
|
|
2020
|
-
[50726, "ReductionMatrix2"],
|
|
2021
|
-
[50727, "AnalogBalance"],
|
|
2022
|
-
[50728, "AsShotNeutral"],
|
|
2023
|
-
[50729, "AsShotWhiteXY"],
|
|
2024
|
-
[50730, "BaselineExposure"],
|
|
2025
|
-
[50731, "BaselineNoise"],
|
|
2026
|
-
[50732, "BaselineSharpness"],
|
|
2027
|
-
[50734, "LinearResponseLimit"],
|
|
2028
|
-
[50735, "CameraSerialNumber"],
|
|
2029
|
-
[50741, "MakerNoteSafety"],
|
|
2030
|
-
[50778, "CalibrationIlluminant1"],
|
|
2031
|
-
[50779, "CalibrationIlluminant2"],
|
|
2032
|
-
[50781, "RawDataUniqueID"],
|
|
2033
|
-
[50827, "OriginalRawFileName"],
|
|
2034
|
-
[50828, "OriginalRawFileData"],
|
|
2035
|
-
[50831, "AsShotICCProfile"],
|
|
2036
|
-
[50832, "AsShotPreProfileMatrix"],
|
|
2037
|
-
[50833, "CurrentICCProfile"],
|
|
2038
|
-
[50834, "CurrentPreProfileMatrix"],
|
|
2039
|
-
[50879, "ColorimetricReference"],
|
|
2040
|
-
[50885, "SRawType"],
|
|
2041
|
-
[50898, "PanasonicTitle"],
|
|
2042
|
-
[50899, "PanasonicTitle2"],
|
|
2043
|
-
[50931, "CameraCalibrationSig"],
|
|
2044
|
-
[50932, "ProfileCalibrationSig"],
|
|
2045
|
-
[50933, "ProfileIFD"],
|
|
2046
|
-
[50934, "AsShotProfileName"],
|
|
2047
|
-
[50936, "ProfileName"],
|
|
2048
|
-
[50937, "ProfileHueSatMapDims"],
|
|
2049
|
-
[50938, "ProfileHueSatMapData1"],
|
|
2050
|
-
[50939, "ProfileHueSatMapData2"],
|
|
2051
|
-
[50940, "ProfileToneCurve"],
|
|
2052
|
-
[50941, "ProfileEmbedPolicy"],
|
|
2053
|
-
[50942, "ProfileCopyright"],
|
|
2054
|
-
[50964, "ForwardMatrix1"],
|
|
2055
|
-
[50965, "ForwardMatrix2"],
|
|
2056
|
-
[50966, "PreviewApplicationName"],
|
|
2057
|
-
[50967, "PreviewApplicationVersion"],
|
|
2058
|
-
[50968, "PreviewSettingsName"],
|
|
2059
|
-
[50969, "PreviewSettingsDigest"],
|
|
2060
|
-
[50970, "PreviewColorSpace"],
|
|
2061
|
-
[50971, "PreviewDateTime"],
|
|
2062
|
-
[50972, "RawImageDigest"],
|
|
2063
|
-
[50973, "OriginalRawFileDigest"],
|
|
2064
|
-
[50981, "ProfileLookTableDims"],
|
|
2065
|
-
[50982, "ProfileLookTableData"],
|
|
2066
|
-
[51043, "TimeCodes"],
|
|
2067
|
-
[51044, "FrameRate"],
|
|
2068
|
-
[51058, "TStop"],
|
|
2069
|
-
[51081, "ReelName"],
|
|
2070
|
-
[51089, "OriginalDefaultFinalSize"],
|
|
2071
|
-
[51090, "OriginalBestQualitySize"],
|
|
2072
|
-
[51091, "OriginalDefaultCropSize"],
|
|
2073
|
-
[51105, "CameraLabel"],
|
|
2074
|
-
[51107, "ProfileHueSatMapEncoding"],
|
|
2075
|
-
[51108, "ProfileLookTableEncoding"],
|
|
2076
|
-
[51109, "BaselineExposureOffset"],
|
|
2077
|
-
[51110, "DefaultBlackRender"],
|
|
2078
|
-
[51111, "NewRawImageDigest"],
|
|
2079
|
-
[51112, "RawToPreviewGain"]
|
|
2080
|
-
]);
|
|
2081
|
-
let At = [
|
|
2082
|
-
[273, "StripOffsets"],
|
|
2083
|
-
[279, "StripByteCounts"],
|
|
2084
|
-
[288, "FreeOffsets"],
|
|
2085
|
-
[289, "FreeByteCounts"],
|
|
2086
|
-
[291, "GrayResponseCurve"],
|
|
2087
|
-
[292, "T4Options"],
|
|
2088
|
-
[293, "T6Options"],
|
|
2089
|
-
[300, "ColorResponseUnit"],
|
|
2090
|
-
[320, "ColorMap"],
|
|
2091
|
-
[324, "TileOffsets"],
|
|
2092
|
-
[325, "TileByteCounts"],
|
|
2093
|
-
[326, "BadFaxLines"],
|
|
2094
|
-
[327, "CleanFaxData"],
|
|
2095
|
-
[328, "ConsecutiveBadFaxLines"],
|
|
2096
|
-
[330, "SubIFD"],
|
|
2097
|
-
[333, "InkNames"],
|
|
2098
|
-
[334, "NumberofInks"],
|
|
2099
|
-
[336, "DotRange"],
|
|
2100
|
-
[338, "ExtraSamples"],
|
|
2101
|
-
[339, "SampleFormat"],
|
|
2102
|
-
[340, "SMinSampleValue"],
|
|
2103
|
-
[341, "SMaxSampleValue"],
|
|
2104
|
-
[342, "TransferRange"],
|
|
2105
|
-
[343, "ClipPath"],
|
|
2106
|
-
[344, "XClipPathUnits"],
|
|
2107
|
-
[345, "YClipPathUnits"],
|
|
2108
|
-
[346, "Indexed"],
|
|
2109
|
-
[347, "JPEGTables"],
|
|
2110
|
-
[351, "OPIProxy"],
|
|
2111
|
-
[400, "GlobalParametersIFD"],
|
|
2112
|
-
[401, "ProfileType"],
|
|
2113
|
-
[402, "FaxProfile"],
|
|
2114
|
-
[403, "CodingMethods"],
|
|
2115
|
-
[404, "VersionYear"],
|
|
2116
|
-
[405, "ModeNumber"],
|
|
2117
|
-
[433, "Decode"],
|
|
2118
|
-
[434, "DefaultImageColor"],
|
|
2119
|
-
[435, "T82Options"],
|
|
2120
|
-
[437, "JPEGTables"],
|
|
2121
|
-
[512, "JPEGProc"],
|
|
2122
|
-
[515, "JPEGRestartInterval"],
|
|
2123
|
-
[517, "JPEGLosslessPredictors"],
|
|
2124
|
-
[518, "JPEGPointTransforms"],
|
|
2125
|
-
[519, "JPEGQTables"],
|
|
2126
|
-
[520, "JPEGDCTables"],
|
|
2127
|
-
[521, "JPEGACTables"],
|
|
2128
|
-
[559, "StripRowCounts"],
|
|
2129
|
-
[999, "USPTOMiscellaneous"],
|
|
2130
|
-
[18247, "XP_DIP_XML"],
|
|
2131
|
-
[18248, "StitchInfo"],
|
|
2132
|
-
[28672, "SonyRawFileType"],
|
|
2133
|
-
[28688, "SonyToneCurve"],
|
|
2134
|
-
[28721, "VignettingCorrection"],
|
|
2135
|
-
[28722, "VignettingCorrParams"],
|
|
2136
|
-
[28724, "ChromaticAberrationCorrection"],
|
|
2137
|
-
[28725, "ChromaticAberrationCorrParams"],
|
|
2138
|
-
[28726, "DistortionCorrection"],
|
|
2139
|
-
[28727, "DistortionCorrParams"],
|
|
2140
|
-
[29895, "SonyCropTopLeft"],
|
|
2141
|
-
[29896, "SonyCropSize"],
|
|
2142
|
-
[32781, "ImageID"],
|
|
2143
|
-
[32931, "WangTag1"],
|
|
2144
|
-
[32932, "WangAnnotation"],
|
|
2145
|
-
[32933, "WangTag3"],
|
|
2146
|
-
[32934, "WangTag4"],
|
|
2147
|
-
[32953, "ImageReferencePoints"],
|
|
2148
|
-
[32954, "RegionXformTackPoint"],
|
|
2149
|
-
[32955, "WarpQuadrilateral"],
|
|
2150
|
-
[32956, "AffineTransformMat"],
|
|
2151
|
-
[32995, "Matteing"],
|
|
2152
|
-
[32996, "DataType"],
|
|
2153
|
-
[32997, "ImageDepth"],
|
|
2154
|
-
[32998, "TileDepth"],
|
|
2155
|
-
[33300, "ImageFullWidth"],
|
|
2156
|
-
[33301, "ImageFullHeight"],
|
|
2157
|
-
[33302, "TextureFormat"],
|
|
2158
|
-
[33303, "WrapModes"],
|
|
2159
|
-
[33304, "FovCot"],
|
|
2160
|
-
[33305, "MatrixWorldToScreen"],
|
|
2161
|
-
[33306, "MatrixWorldToCamera"],
|
|
2162
|
-
[33405, "Model2"],
|
|
2163
|
-
[33421, "CFARepeatPatternDim"],
|
|
2164
|
-
[33422, "CFAPattern2"],
|
|
2165
|
-
[33423, "BatteryLevel"],
|
|
2166
|
-
[33424, "KodakIFD"],
|
|
2167
|
-
[33445, "MDFileTag"],
|
|
2168
|
-
[33446, "MDScalePixel"],
|
|
2169
|
-
[33447, "MDColorTable"],
|
|
2170
|
-
[33448, "MDLabName"],
|
|
2171
|
-
[33449, "MDSampleInfo"],
|
|
2172
|
-
[33450, "MDPrepDate"],
|
|
2173
|
-
[33451, "MDPrepTime"],
|
|
2174
|
-
[33452, "MDFileUnits"],
|
|
2175
|
-
[33589, "AdventScale"],
|
|
2176
|
-
[33590, "AdventRevision"],
|
|
2177
|
-
[33628, "UIC1Tag"],
|
|
2178
|
-
[33629, "UIC2Tag"],
|
|
2179
|
-
[33630, "UIC3Tag"],
|
|
2180
|
-
[33631, "UIC4Tag"],
|
|
2181
|
-
[33918, "IntergraphPacketData"],
|
|
2182
|
-
[33919, "IntergraphFlagRegisters"],
|
|
2183
|
-
[33921, "INGRReserved"],
|
|
2184
|
-
[34016, "Site"],
|
|
2185
|
-
[34017, "ColorSequence"],
|
|
2186
|
-
[34018, "IT8Header"],
|
|
2187
|
-
[34019, "RasterPadding"],
|
|
2188
|
-
[34020, "BitsPerRunLength"],
|
|
2189
|
-
[34021, "BitsPerExtendedRunLength"],
|
|
2190
|
-
[34022, "ColorTable"],
|
|
2191
|
-
[34023, "ImageColorIndicator"],
|
|
2192
|
-
[34024, "BackgroundColorIndicator"],
|
|
2193
|
-
[34025, "ImageColorValue"],
|
|
2194
|
-
[34026, "BackgroundColorValue"],
|
|
2195
|
-
[34027, "PixelIntensityRange"],
|
|
2196
|
-
[34028, "TransparencyIndicator"],
|
|
2197
|
-
[34029, "ColorCharacterization"],
|
|
2198
|
-
[34030, "HCUsage"],
|
|
2199
|
-
[34031, "TrapIndicator"],
|
|
2200
|
-
[34032, "CMYKEquivalent"],
|
|
2201
|
-
[34152, "AFCP_IPTC"],
|
|
2202
|
-
[34232, "PixelMagicJBIGOptions"],
|
|
2203
|
-
[34263, "JPLCartoIFD"],
|
|
2204
|
-
[34306, "WB_GRGBLevels"],
|
|
2205
|
-
[34310, "LeafData"],
|
|
2206
|
-
[34687, "TIFF_FXExtensions"],
|
|
2207
|
-
[34688, "MultiProfiles"],
|
|
2208
|
-
[34689, "SharedData"],
|
|
2209
|
-
[34690, "T88Options"],
|
|
2210
|
-
[34732, "ImageLayer"],
|
|
2211
|
-
[34750, "JBIGOptions"],
|
|
2212
|
-
[34856, "Opto-ElectricConvFactor"],
|
|
2213
|
-
[34857, "Interlace"],
|
|
2214
|
-
[34908, "FaxRecvParams"],
|
|
2215
|
-
[34909, "FaxSubAddress"],
|
|
2216
|
-
[34910, "FaxRecvTime"],
|
|
2217
|
-
[34929, "FedexEDR"],
|
|
2218
|
-
[34954, "LeafSubIFD"],
|
|
2219
|
-
[37387, "FlashEnergy"],
|
|
2220
|
-
[37388, "SpatialFrequencyResponse"],
|
|
2221
|
-
[37389, "Noise"],
|
|
2222
|
-
[37390, "FocalPlaneXResolution"],
|
|
2223
|
-
[37391, "FocalPlaneYResolution"],
|
|
2224
|
-
[37392, "FocalPlaneResolutionUnit"],
|
|
2225
|
-
[37397, "ExposureIndex"],
|
|
2226
|
-
[37398, "TIFF-EPStandardID"],
|
|
2227
|
-
[37399, "SensingMethod"],
|
|
2228
|
-
[37434, "CIP3DataFile"],
|
|
2229
|
-
[37435, "CIP3Sheet"],
|
|
2230
|
-
[37436, "CIP3Side"],
|
|
2231
|
-
[37439, "StoNits"],
|
|
2232
|
-
[37679, "MSDocumentText"],
|
|
2233
|
-
[37680, "MSPropertySetStorage"],
|
|
2234
|
-
[37681, "MSDocumentTextPosition"],
|
|
2235
|
-
[37724, "ImageSourceData"],
|
|
2236
|
-
[40965, "InteropIFD"],
|
|
2237
|
-
[40976, "SamsungRawPointersOffset"],
|
|
2238
|
-
[40977, "SamsungRawPointersLength"],
|
|
2239
|
-
[41217, "SamsungRawByteOrder"],
|
|
2240
|
-
[41218, "SamsungRawUnknown"],
|
|
2241
|
-
[41484, "SpatialFrequencyResponse"],
|
|
2242
|
-
[41485, "Noise"],
|
|
2243
|
-
[41489, "ImageNumber"],
|
|
2244
|
-
[41490, "SecurityClassification"],
|
|
2245
|
-
[41491, "ImageHistory"],
|
|
2246
|
-
[41494, "TIFF-EPStandardID"],
|
|
2247
|
-
[41995, "DeviceSettingDescription"],
|
|
2248
|
-
[42112, "GDALMetadata"],
|
|
2249
|
-
[42113, "GDALNoData"],
|
|
2250
|
-
[44992, "ExpandSoftware"],
|
|
2251
|
-
[44993, "ExpandLens"],
|
|
2252
|
-
[44994, "ExpandFilm"],
|
|
2253
|
-
[44995, "ExpandFilterLens"],
|
|
2254
|
-
[44996, "ExpandScanner"],
|
|
2255
|
-
[44997, "ExpandFlashLamp"],
|
|
2256
|
-
[46275, "HasselbladRawImage"],
|
|
2257
|
-
[48129, "PixelFormat"],
|
|
2258
|
-
[48130, "Transformation"],
|
|
2259
|
-
[48131, "Uncompressed"],
|
|
2260
|
-
[48132, "ImageType"],
|
|
2261
|
-
[48256, "ImageWidth"],
|
|
2262
|
-
[48257, "ImageHeight"],
|
|
2263
|
-
[48258, "WidthResolution"],
|
|
2264
|
-
[48259, "HeightResolution"],
|
|
2265
|
-
[48320, "ImageOffset"],
|
|
2266
|
-
[48321, "ImageByteCount"],
|
|
2267
|
-
[48322, "AlphaOffset"],
|
|
2268
|
-
[48323, "AlphaByteCount"],
|
|
2269
|
-
[48324, "ImageDataDiscard"],
|
|
2270
|
-
[48325, "AlphaDataDiscard"],
|
|
2271
|
-
[50215, "OceScanjobDesc"],
|
|
2272
|
-
[50216, "OceApplicationSelector"],
|
|
2273
|
-
[50217, "OceIDNumber"],
|
|
2274
|
-
[50218, "OceImageLogic"],
|
|
2275
|
-
[50255, "Annotations"],
|
|
2276
|
-
[50459, "HasselbladExif"],
|
|
2277
|
-
[50547, "OriginalFileName"],
|
|
2278
|
-
[50560, "USPTOOriginalContentType"],
|
|
2279
|
-
[50656, "CR2CFAPattern"],
|
|
2280
|
-
[50710, "CFAPlaneColor"],
|
|
2281
|
-
[50711, "CFALayout"],
|
|
2282
|
-
[50712, "LinearizationTable"],
|
|
2283
|
-
[50713, "BlackLevelRepeatDim"],
|
|
2284
|
-
[50714, "BlackLevel"],
|
|
2285
|
-
[50715, "BlackLevelDeltaH"],
|
|
2286
|
-
[50716, "BlackLevelDeltaV"],
|
|
2287
|
-
[50717, "WhiteLevel"],
|
|
2288
|
-
[50718, "DefaultScale"],
|
|
2289
|
-
[50719, "DefaultCropOrigin"],
|
|
2290
|
-
[50720, "DefaultCropSize"],
|
|
2291
|
-
[50733, "BayerGreenSplit"],
|
|
2292
|
-
[50737, "ChromaBlurRadius"],
|
|
2293
|
-
[50738, "AntiAliasStrength"],
|
|
2294
|
-
[50752, "RawImageSegmentation"],
|
|
2295
|
-
[50780, "BestQualityScale"],
|
|
2296
|
-
[50784, "AliasLayerMetadata"],
|
|
2297
|
-
[50829, "ActiveArea"],
|
|
2298
|
-
[50830, "MaskedAreas"],
|
|
2299
|
-
[50935, "NoiseReductionApplied"],
|
|
2300
|
-
[50974, "SubTileBlockSize"],
|
|
2301
|
-
[50975, "RowInterleaveFactor"],
|
|
2302
|
-
[51008, "OpcodeList1"],
|
|
2303
|
-
[51009, "OpcodeList2"],
|
|
2304
|
-
[51022, "OpcodeList3"],
|
|
2305
|
-
[51041, "NoiseProfile"],
|
|
2306
|
-
[51114, "CacheVersion"],
|
|
2307
|
-
[51125, "DefaultUserCrop"],
|
|
2308
|
-
[51157, "NikonNEFInfo"],
|
|
2309
|
-
[65024, "KdcIFD"]
|
|
2310
|
-
];
|
|
2311
|
-
E(N, "ifd0", At), E(N, "exif", At), B(G, "gps", [[23, {
|
|
2312
|
-
M: "Magnetic North",
|
|
2313
|
-
T: "True North"
|
|
2314
|
-
}], [25, {
|
|
2315
|
-
K: "Kilometers",
|
|
2316
|
-
M: "Miles",
|
|
2317
|
-
N: "Nautical Miles"
|
|
2318
|
-
}]]);
|
|
2319
|
-
class Dt extends ge {
|
|
2320
|
-
static canHandle(e, t) {
|
|
2321
|
-
return 224 === e.getUint8(t + 1) && 1246120262 === e.getUint32(t + 4) && 0 === e.getUint8(t + 8);
|
|
2322
|
-
}
|
|
2323
|
-
parse() {
|
|
2324
|
-
return this.parseTags(), this.translate(), this.output;
|
|
2325
|
-
}
|
|
2326
|
-
parseTags() {
|
|
2327
|
-
this.raw = /* @__PURE__ */ new Map([
|
|
2328
|
-
[0, this.chunk.getUint16(0)],
|
|
2329
|
-
[2, this.chunk.getUint8(2)],
|
|
2330
|
-
[3, this.chunk.getUint16(3)],
|
|
2331
|
-
[5, this.chunk.getUint16(5)],
|
|
2332
|
-
[7, this.chunk.getUint8(7)],
|
|
2333
|
-
[8, this.chunk.getUint8(8)]
|
|
2334
|
-
]);
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
f(Dt, "type", "jfif"), f(Dt, "headerLength", 9), A.set("jfif", Dt), B(N, "jfif", [
|
|
2338
|
-
[0, "JFIFVersion"],
|
|
2339
|
-
[2, "ResolutionUnit"],
|
|
2340
|
-
[3, "XResolution"],
|
|
2341
|
-
[5, "YResolution"],
|
|
2342
|
-
[7, "ThumbnailWidth"],
|
|
2343
|
-
[8, "ThumbnailHeight"]
|
|
2344
|
-
]);
|
|
2345
|
-
class Ot extends ge {
|
|
2346
|
-
parse() {
|
|
2347
|
-
return this.parseTags(), this.translate(), this.output;
|
|
2348
|
-
}
|
|
2349
|
-
parseTags() {
|
|
2350
|
-
this.raw = new Map([
|
|
2351
|
-
[0, this.chunk.getUint32(0)],
|
|
2352
|
-
[4, this.chunk.getUint32(4)],
|
|
2353
|
-
[8, this.chunk.getUint8(8)],
|
|
2354
|
-
[9, this.chunk.getUint8(9)],
|
|
2355
|
-
[10, this.chunk.getUint8(10)],
|
|
2356
|
-
[11, this.chunk.getUint8(11)],
|
|
2357
|
-
[12, this.chunk.getUint8(12)],
|
|
2358
|
-
...Array.from(this.raw)
|
|
2359
|
-
]);
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
f(Ot, "type", "ihdr"), A.set("ihdr", Ot), B(N, "ihdr", [
|
|
2363
|
-
[0, "ImageWidth"],
|
|
2364
|
-
[4, "ImageHeight"],
|
|
2365
|
-
[8, "BitDepth"],
|
|
2366
|
-
[9, "ColorType"],
|
|
2367
|
-
[10, "Compression"],
|
|
2368
|
-
[11, "Filter"],
|
|
2369
|
-
[12, "Interlace"]
|
|
2370
|
-
]), B(G, "ihdr", [
|
|
2371
|
-
[9, {
|
|
2372
|
-
0: "Grayscale",
|
|
2373
|
-
2: "RGB",
|
|
2374
|
-
3: "Palette",
|
|
2375
|
-
4: "Grayscale with Alpha",
|
|
2376
|
-
6: "RGB with Alpha",
|
|
2377
|
-
DEFAULT: "Unknown"
|
|
2378
|
-
}],
|
|
2379
|
-
[10, {
|
|
2380
|
-
0: "Deflate/Inflate",
|
|
2381
|
-
DEFAULT: "Unknown"
|
|
2382
|
-
}],
|
|
2383
|
-
[11, {
|
|
2384
|
-
0: "Adaptive",
|
|
2385
|
-
DEFAULT: "Unknown"
|
|
2386
|
-
}],
|
|
2387
|
-
[12, {
|
|
2388
|
-
0: "Noninterlaced",
|
|
2389
|
-
1: "Adam7 Interlace",
|
|
2390
|
-
DEFAULT: "Unknown"
|
|
2391
|
-
}]
|
|
2392
|
-
]);
|
|
2393
|
-
const xt = "\0\0\0\0";
|
|
2394
|
-
class vt extends ge {
|
|
2395
|
-
static canHandle(e, t) {
|
|
2396
|
-
return 226 === e.getUint8(t + 1) && 1229144927 === e.getUint32(t + 4);
|
|
2397
|
-
}
|
|
2398
|
-
static findPosition(e, t) {
|
|
2399
|
-
let i = super.findPosition(e, t);
|
|
2400
|
-
return i.chunkNumber = e.getUint8(t + 16), i.chunkCount = e.getUint8(t + 17), i.multiSegment = i.chunkCount > 1, i;
|
|
2401
|
-
}
|
|
2402
|
-
static handleMultiSegments(e) {
|
|
2403
|
-
return function(e) {
|
|
2404
|
-
let t = function(e) {
|
|
2405
|
-
let t = e[0].constructor, i = 0;
|
|
2406
|
-
for (let t of e) i += t.length;
|
|
2407
|
-
let n = new t(i), s = 0;
|
|
2408
|
-
for (let t of e) n.set(t, s), s += t.length;
|
|
2409
|
-
return n;
|
|
2410
|
-
}(e.map(((e) => e.chunk.toUint8())));
|
|
2411
|
-
return new I(t);
|
|
2412
|
-
}(e);
|
|
2413
|
-
}
|
|
2414
|
-
parse() {
|
|
2415
|
-
return this.raw = /* @__PURE__ */ new Map(), this.parseHeader(), this.parseTags(), this.translate(), this.output;
|
|
2416
|
-
}
|
|
2417
|
-
parseHeader() {
|
|
2418
|
-
let { raw: e } = this;
|
|
2419
|
-
this.chunk.byteLength < 84 && m("ICC header is too short");
|
|
2420
|
-
for (let [t, i] of Object.entries(Mt)) {
|
|
2421
|
-
t = parseInt(t, 10);
|
|
2422
|
-
let n = i(this.chunk, t);
|
|
2423
|
-
n !== xt && e.set(t, n);
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
parseTags() {
|
|
2427
|
-
let e, t, i, n, s, { raw: r } = this, a = this.chunk.getUint32(128), o = 132, l = this.chunk.byteLength;
|
|
2428
|
-
for (; a--;) {
|
|
2429
|
-
if (e = this.chunk.getString(o, 4), t = this.chunk.getUint32(o + 4), i = this.chunk.getUint32(o + 8), n = this.chunk.getString(t, 4), t + i > l) return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");
|
|
2430
|
-
s = this.parseTag(n, t, i), void 0 !== s && s !== xt && r.set(e, s), o += 12;
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
parseTag(e, t, i) {
|
|
2434
|
-
switch (e) {
|
|
2435
|
-
case "desc": return this.parseDesc(t);
|
|
2436
|
-
case "mluc": return this.parseMluc(t);
|
|
2437
|
-
case "text": return this.parseText(t, i);
|
|
2438
|
-
case "sig ": return this.parseSig(t);
|
|
2439
|
-
}
|
|
2440
|
-
if (!(t + i > this.chunk.byteLength)) return this.chunk.getUint8Array(t, i);
|
|
2441
|
-
}
|
|
2442
|
-
parseDesc(e) {
|
|
2443
|
-
let t = this.chunk.getUint32(e + 8) - 1;
|
|
2444
|
-
return S(this.chunk.getString(e + 12, t));
|
|
2445
|
-
}
|
|
2446
|
-
parseText(e, t) {
|
|
2447
|
-
return S(this.chunk.getString(e + 8, t - 8));
|
|
2448
|
-
}
|
|
2449
|
-
parseSig(e) {
|
|
2450
|
-
return S(this.chunk.getString(e + 8, 4));
|
|
2451
|
-
}
|
|
2452
|
-
parseMluc(e) {
|
|
2453
|
-
let { chunk: t } = this, i = t.getUint32(e + 8), n = t.getUint32(e + 12), s = e + 16, r = [];
|
|
2454
|
-
for (let a = 0; a < i; a++) {
|
|
2455
|
-
let i = t.getString(s + 0, 2), a = t.getString(s + 2, 2), o = t.getUint32(s + 4), l = t.getUint32(s + 8) + e, h = S(t.getUnicodeString(l, o));
|
|
2456
|
-
r.push({
|
|
2457
|
-
lang: i,
|
|
2458
|
-
country: a,
|
|
2459
|
-
text: h
|
|
2460
|
-
}), s += n;
|
|
2461
|
-
}
|
|
2462
|
-
return 1 === i ? r[0].text : r;
|
|
2463
|
-
}
|
|
2464
|
-
translateValue(e, t) {
|
|
2465
|
-
return "string" == typeof e ? t[e] || t[e.toLowerCase()] || e : t[e] || e;
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
f(vt, "type", "icc"), f(vt, "multiSegment", !0), f(vt, "headerLength", 18);
|
|
2469
|
-
const Mt = {
|
|
2470
|
-
4: Rt,
|
|
2471
|
-
8: function(e, t) {
|
|
2472
|
-
return [
|
|
2473
|
-
e.getUint8(t),
|
|
2474
|
-
e.getUint8(t + 1) >> 4,
|
|
2475
|
-
e.getUint8(t + 1) % 16
|
|
2476
|
-
].map(((e) => e.toString(10))).join(".");
|
|
2477
|
-
},
|
|
2478
|
-
12: Rt,
|
|
2479
|
-
16: Rt,
|
|
2480
|
-
20: Rt,
|
|
2481
|
-
24: function(e, t) {
|
|
2482
|
-
const i = e.getUint16(t), n = e.getUint16(t + 2) - 1, s = e.getUint16(t + 4), r = e.getUint16(t + 6), a = e.getUint16(t + 8), o = e.getUint16(t + 10);
|
|
2483
|
-
return new Date(Date.UTC(i, n, s, r, a, o));
|
|
2484
|
-
},
|
|
2485
|
-
36: Rt,
|
|
2486
|
-
40: Rt,
|
|
2487
|
-
48: Rt,
|
|
2488
|
-
52: Rt,
|
|
2489
|
-
64: (e, t) => e.getUint32(t),
|
|
2490
|
-
80: Rt
|
|
2491
|
-
};
|
|
2492
|
-
function Rt(e, t) {
|
|
2493
|
-
return S(e.getString(t, 4));
|
|
2494
|
-
}
|
|
2495
|
-
A.set("icc", vt), B(N, "icc", [
|
|
2496
|
-
[4, "ProfileCMMType"],
|
|
2497
|
-
[8, "ProfileVersion"],
|
|
2498
|
-
[12, "ProfileClass"],
|
|
2499
|
-
[16, "ColorSpaceData"],
|
|
2500
|
-
[20, "ProfileConnectionSpace"],
|
|
2501
|
-
[24, "ProfileDateTime"],
|
|
2502
|
-
[36, "ProfileFileSignature"],
|
|
2503
|
-
[40, "PrimaryPlatform"],
|
|
2504
|
-
[44, "CMMFlags"],
|
|
2505
|
-
[48, "DeviceManufacturer"],
|
|
2506
|
-
[52, "DeviceModel"],
|
|
2507
|
-
[56, "DeviceAttributes"],
|
|
2508
|
-
[64, "RenderingIntent"],
|
|
2509
|
-
[68, "ConnectionSpaceIlluminant"],
|
|
2510
|
-
[80, "ProfileCreator"],
|
|
2511
|
-
[84, "ProfileID"],
|
|
2512
|
-
["Header", "ProfileHeader"],
|
|
2513
|
-
["MS00", "WCSProfiles"],
|
|
2514
|
-
["bTRC", "BlueTRC"],
|
|
2515
|
-
["bXYZ", "BlueMatrixColumn"],
|
|
2516
|
-
["bfd", "UCRBG"],
|
|
2517
|
-
["bkpt", "MediaBlackPoint"],
|
|
2518
|
-
["calt", "CalibrationDateTime"],
|
|
2519
|
-
["chad", "ChromaticAdaptation"],
|
|
2520
|
-
["chrm", "Chromaticity"],
|
|
2521
|
-
["ciis", "ColorimetricIntentImageState"],
|
|
2522
|
-
["clot", "ColorantTableOut"],
|
|
2523
|
-
["clro", "ColorantOrder"],
|
|
2524
|
-
["clrt", "ColorantTable"],
|
|
2525
|
-
["cprt", "ProfileCopyright"],
|
|
2526
|
-
["crdi", "CRDInfo"],
|
|
2527
|
-
["desc", "ProfileDescription"],
|
|
2528
|
-
["devs", "DeviceSettings"],
|
|
2529
|
-
["dmdd", "DeviceModelDesc"],
|
|
2530
|
-
["dmnd", "DeviceMfgDesc"],
|
|
2531
|
-
["dscm", "ProfileDescriptionML"],
|
|
2532
|
-
["fpce", "FocalPlaneColorimetryEstimates"],
|
|
2533
|
-
["gTRC", "GreenTRC"],
|
|
2534
|
-
["gXYZ", "GreenMatrixColumn"],
|
|
2535
|
-
["gamt", "Gamut"],
|
|
2536
|
-
["kTRC", "GrayTRC"],
|
|
2537
|
-
["lumi", "Luminance"],
|
|
2538
|
-
["meas", "Measurement"],
|
|
2539
|
-
["meta", "Metadata"],
|
|
2540
|
-
["mmod", "MakeAndModel"],
|
|
2541
|
-
["ncl2", "NamedColor2"],
|
|
2542
|
-
["ncol", "NamedColor"],
|
|
2543
|
-
["ndin", "NativeDisplayInfo"],
|
|
2544
|
-
["pre0", "Preview0"],
|
|
2545
|
-
["pre1", "Preview1"],
|
|
2546
|
-
["pre2", "Preview2"],
|
|
2547
|
-
["ps2i", "PS2RenderingIntent"],
|
|
2548
|
-
["ps2s", "PostScript2CSA"],
|
|
2549
|
-
["psd0", "PostScript2CRD0"],
|
|
2550
|
-
["psd1", "PostScript2CRD1"],
|
|
2551
|
-
["psd2", "PostScript2CRD2"],
|
|
2552
|
-
["psd3", "PostScript2CRD3"],
|
|
2553
|
-
["pseq", "ProfileSequenceDesc"],
|
|
2554
|
-
["psid", "ProfileSequenceIdentifier"],
|
|
2555
|
-
["psvm", "PS2CRDVMSize"],
|
|
2556
|
-
["rTRC", "RedTRC"],
|
|
2557
|
-
["rXYZ", "RedMatrixColumn"],
|
|
2558
|
-
["resp", "OutputResponse"],
|
|
2559
|
-
["rhoc", "ReflectionHardcopyOrigColorimetry"],
|
|
2560
|
-
["rig0", "PerceptualRenderingIntentGamut"],
|
|
2561
|
-
["rig2", "SaturationRenderingIntentGamut"],
|
|
2562
|
-
["rpoc", "ReflectionPrintOutputColorimetry"],
|
|
2563
|
-
["sape", "SceneAppearanceEstimates"],
|
|
2564
|
-
["scoe", "SceneColorimetryEstimates"],
|
|
2565
|
-
["scrd", "ScreeningDesc"],
|
|
2566
|
-
["scrn", "Screening"],
|
|
2567
|
-
["targ", "CharTarget"],
|
|
2568
|
-
["tech", "Technology"],
|
|
2569
|
-
["vcgt", "VideoCardGamma"],
|
|
2570
|
-
["view", "ViewingConditions"],
|
|
2571
|
-
["vued", "ViewingCondDesc"],
|
|
2572
|
-
["wtpt", "MediaWhitePoint"]
|
|
2573
|
-
]);
|
|
2574
|
-
const Lt = {
|
|
2575
|
-
"4d2p": "Erdt Systems",
|
|
2576
|
-
AAMA: "Aamazing Technologies",
|
|
2577
|
-
ACER: "Acer",
|
|
2578
|
-
ACLT: "Acolyte Color Research",
|
|
2579
|
-
ACTI: "Actix Sytems",
|
|
2580
|
-
ADAR: "Adara Technology",
|
|
2581
|
-
ADBE: "Adobe",
|
|
2582
|
-
ADI: "ADI Systems",
|
|
2583
|
-
AGFA: "Agfa Graphics",
|
|
2584
|
-
ALMD: "Alps Electric",
|
|
2585
|
-
ALPS: "Alps Electric",
|
|
2586
|
-
ALWN: "Alwan Color Expertise",
|
|
2587
|
-
AMTI: "Amiable Technologies",
|
|
2588
|
-
AOC: "AOC International",
|
|
2589
|
-
APAG: "Apago",
|
|
2590
|
-
APPL: "Apple Computer",
|
|
2591
|
-
AST: "AST",
|
|
2592
|
-
"AT&T": "AT&T",
|
|
2593
|
-
BAEL: "BARBIERI electronic",
|
|
2594
|
-
BRCO: "Barco NV",
|
|
2595
|
-
BRKP: "Breakpoint",
|
|
2596
|
-
BROT: "Brother",
|
|
2597
|
-
BULL: "Bull",
|
|
2598
|
-
BUS: "Bus Computer Systems",
|
|
2599
|
-
"C-IT": "C-Itoh",
|
|
2600
|
-
CAMR: "Intel",
|
|
2601
|
-
CANO: "Canon",
|
|
2602
|
-
CARR: "Carroll Touch",
|
|
2603
|
-
CASI: "Casio",
|
|
2604
|
-
CBUS: "Colorbus PL",
|
|
2605
|
-
CEL: "Crossfield",
|
|
2606
|
-
CELx: "Crossfield",
|
|
2607
|
-
CGS: "CGS Publishing Technologies International",
|
|
2608
|
-
CHM: "Rochester Robotics",
|
|
2609
|
-
CIGL: "Colour Imaging Group, London",
|
|
2610
|
-
CITI: "Citizen",
|
|
2611
|
-
CL00: "Candela",
|
|
2612
|
-
CLIQ: "Color IQ",
|
|
2613
|
-
CMCO: "Chromaco",
|
|
2614
|
-
CMiX: "CHROMiX",
|
|
2615
|
-
COLO: "Colorgraphic Communications",
|
|
2616
|
-
COMP: "Compaq",
|
|
2617
|
-
COMp: "Compeq/Focus Technology",
|
|
2618
|
-
CONR: "Conrac Display Products",
|
|
2619
|
-
CORD: "Cordata Technologies",
|
|
2620
|
-
CPQ: "Compaq",
|
|
2621
|
-
CPRO: "ColorPro",
|
|
2622
|
-
CRN: "Cornerstone",
|
|
2623
|
-
CTX: "CTX International",
|
|
2624
|
-
CVIS: "ColorVision",
|
|
2625
|
-
CWC: "Fujitsu Laboratories",
|
|
2626
|
-
DARI: "Darius Technology",
|
|
2627
|
-
DATA: "Dataproducts",
|
|
2628
|
-
DCP: "Dry Creek Photo",
|
|
2629
|
-
DCRC: "Digital Contents Resource Center, Chung-Ang University",
|
|
2630
|
-
DELL: "Dell Computer",
|
|
2631
|
-
DIC: "Dainippon Ink and Chemicals",
|
|
2632
|
-
DICO: "Diconix",
|
|
2633
|
-
DIGI: "Digital",
|
|
2634
|
-
"DL&C": "Digital Light & Color",
|
|
2635
|
-
DPLG: "Doppelganger",
|
|
2636
|
-
DS: "Dainippon Screen",
|
|
2637
|
-
DSOL: "DOOSOL",
|
|
2638
|
-
DUPN: "DuPont",
|
|
2639
|
-
EPSO: "Epson",
|
|
2640
|
-
ESKO: "Esko-Graphics",
|
|
2641
|
-
ETRI: "Electronics and Telecommunications Research Institute",
|
|
2642
|
-
EVER: "Everex Systems",
|
|
2643
|
-
EXAC: "ExactCODE",
|
|
2644
|
-
Eizo: "Eizo",
|
|
2645
|
-
FALC: "Falco Data Products",
|
|
2646
|
-
FF: "Fuji Photo Film",
|
|
2647
|
-
FFEI: "FujiFilm Electronic Imaging",
|
|
2648
|
-
FNRD: "Fnord Software",
|
|
2649
|
-
FORA: "Fora",
|
|
2650
|
-
FORE: "Forefront Technology",
|
|
2651
|
-
FP: "Fujitsu",
|
|
2652
|
-
FPA: "WayTech Development",
|
|
2653
|
-
FUJI: "Fujitsu",
|
|
2654
|
-
FX: "Fuji Xerox",
|
|
2655
|
-
GCC: "GCC Technologies",
|
|
2656
|
-
GGSL: "Global Graphics Software",
|
|
2657
|
-
GMB: "Gretagmacbeth",
|
|
2658
|
-
GMG: "GMG",
|
|
2659
|
-
GOLD: "GoldStar Technology",
|
|
2660
|
-
GOOG: "Google",
|
|
2661
|
-
GPRT: "Giantprint",
|
|
2662
|
-
GTMB: "Gretagmacbeth",
|
|
2663
|
-
GVC: "WayTech Development",
|
|
2664
|
-
GW2K: "Sony",
|
|
2665
|
-
HCI: "HCI",
|
|
2666
|
-
HDM: "Heidelberger Druckmaschinen",
|
|
2667
|
-
HERM: "Hermes",
|
|
2668
|
-
HITA: "Hitachi America",
|
|
2669
|
-
HP: "Hewlett-Packard",
|
|
2670
|
-
HTC: "Hitachi",
|
|
2671
|
-
HiTi: "HiTi Digital",
|
|
2672
|
-
IBM: "IBM",
|
|
2673
|
-
IDNT: "Scitex",
|
|
2674
|
-
IEC: "Hewlett-Packard",
|
|
2675
|
-
IIYA: "Iiyama North America",
|
|
2676
|
-
IKEG: "Ikegami Electronics",
|
|
2677
|
-
IMAG: "Image Systems",
|
|
2678
|
-
IMI: "Ingram Micro",
|
|
2679
|
-
INTC: "Intel",
|
|
2680
|
-
INTL: "N/A (INTL)",
|
|
2681
|
-
INTR: "Intra Electronics",
|
|
2682
|
-
IOCO: "Iocomm International Technology",
|
|
2683
|
-
IPS: "InfoPrint Solutions Company",
|
|
2684
|
-
IRIS: "Scitex",
|
|
2685
|
-
ISL: "Ichikawa Soft Laboratory",
|
|
2686
|
-
ITNL: "N/A (ITNL)",
|
|
2687
|
-
IVM: "IVM",
|
|
2688
|
-
IWAT: "Iwatsu Electric",
|
|
2689
|
-
Idnt: "Scitex",
|
|
2690
|
-
Inca: "Inca Digital Printers",
|
|
2691
|
-
Iris: "Scitex",
|
|
2692
|
-
JPEG: "Joint Photographic Experts Group",
|
|
2693
|
-
JSFT: "Jetsoft Development",
|
|
2694
|
-
JVC: "JVC Information Products",
|
|
2695
|
-
KART: "Scitex",
|
|
2696
|
-
KFC: "KFC Computek Components",
|
|
2697
|
-
KLH: "KLH Computers",
|
|
2698
|
-
KMHD: "Konica Minolta",
|
|
2699
|
-
KNCA: "Konica",
|
|
2700
|
-
KODA: "Kodak",
|
|
2701
|
-
KYOC: "Kyocera",
|
|
2702
|
-
Kart: "Scitex",
|
|
2703
|
-
LCAG: "Leica",
|
|
2704
|
-
LCCD: "Leeds Colour",
|
|
2705
|
-
LDAK: "Left Dakota",
|
|
2706
|
-
LEAD: "Leading Technology",
|
|
2707
|
-
LEXM: "Lexmark International",
|
|
2708
|
-
LINK: "Link Computer",
|
|
2709
|
-
LINO: "Linotronic",
|
|
2710
|
-
LITE: "Lite-On",
|
|
2711
|
-
Leaf: "Leaf",
|
|
2712
|
-
Lino: "Linotronic",
|
|
2713
|
-
MAGC: "Mag Computronic",
|
|
2714
|
-
MAGI: "MAG Innovision",
|
|
2715
|
-
MANN: "Mannesmann",
|
|
2716
|
-
MICN: "Micron Technology",
|
|
2717
|
-
MICR: "Microtek",
|
|
2718
|
-
MICV: "Microvitec",
|
|
2719
|
-
MINO: "Minolta",
|
|
2720
|
-
MITS: "Mitsubishi Electronics America",
|
|
2721
|
-
MITs: "Mitsuba",
|
|
2722
|
-
MNLT: "Minolta",
|
|
2723
|
-
MODG: "Modgraph",
|
|
2724
|
-
MONI: "Monitronix",
|
|
2725
|
-
MONS: "Monaco Systems",
|
|
2726
|
-
MORS: "Morse Technology",
|
|
2727
|
-
MOTI: "Motive Systems",
|
|
2728
|
-
MSFT: "Microsoft",
|
|
2729
|
-
MUTO: "MUTOH INDUSTRIES",
|
|
2730
|
-
Mits: "Mitsubishi Electric",
|
|
2731
|
-
NANA: "NANAO",
|
|
2732
|
-
NEC: "NEC",
|
|
2733
|
-
NEXP: "NexPress Solutions",
|
|
2734
|
-
NISS: "Nissei Sangyo America",
|
|
2735
|
-
NKON: "Nikon",
|
|
2736
|
-
NONE: "none",
|
|
2737
|
-
OCE: "Oce Technologies",
|
|
2738
|
-
OCEC: "OceColor",
|
|
2739
|
-
OKI: "Oki",
|
|
2740
|
-
OKID: "Okidata",
|
|
2741
|
-
OKIP: "Okidata",
|
|
2742
|
-
OLIV: "Olivetti",
|
|
2743
|
-
OLYM: "Olympus",
|
|
2744
|
-
ONYX: "Onyx Graphics",
|
|
2745
|
-
OPTI: "Optiquest",
|
|
2746
|
-
PACK: "Packard Bell",
|
|
2747
|
-
PANA: "Matsushita Electric Industrial",
|
|
2748
|
-
PANT: "Pantone",
|
|
2749
|
-
PBN: "Packard Bell",
|
|
2750
|
-
PFU: "PFU",
|
|
2751
|
-
PHIL: "Philips Consumer Electronics",
|
|
2752
|
-
PNTX: "HOYA",
|
|
2753
|
-
POne: "Phase One A/S",
|
|
2754
|
-
PREM: "Premier Computer Innovations",
|
|
2755
|
-
PRIN: "Princeton Graphic Systems",
|
|
2756
|
-
PRIP: "Princeton Publishing Labs",
|
|
2757
|
-
QLUX: "Hong Kong",
|
|
2758
|
-
QMS: "QMS",
|
|
2759
|
-
QPCD: "QPcard AB",
|
|
2760
|
-
QUAD: "QuadLaser",
|
|
2761
|
-
QUME: "Qume",
|
|
2762
|
-
RADI: "Radius",
|
|
2763
|
-
RDDx: "Integrated Color Solutions",
|
|
2764
|
-
RDG: "Roland DG",
|
|
2765
|
-
REDM: "REDMS Group",
|
|
2766
|
-
RELI: "Relisys",
|
|
2767
|
-
RGMS: "Rolf Gierling Multitools",
|
|
2768
|
-
RICO: "Ricoh",
|
|
2769
|
-
RNLD: "Edmund Ronald",
|
|
2770
|
-
ROYA: "Royal",
|
|
2771
|
-
RPC: "Ricoh Printing Systems",
|
|
2772
|
-
RTL: "Royal Information Electronics",
|
|
2773
|
-
SAMP: "Sampo",
|
|
2774
|
-
SAMS: "Samsung",
|
|
2775
|
-
SANT: "Jaime Santana Pomares",
|
|
2776
|
-
SCIT: "Scitex",
|
|
2777
|
-
SCRN: "Dainippon Screen",
|
|
2778
|
-
SDP: "Scitex",
|
|
2779
|
-
SEC: "Samsung",
|
|
2780
|
-
SEIK: "Seiko Instruments",
|
|
2781
|
-
SEIk: "Seikosha",
|
|
2782
|
-
SGUY: "ScanGuy.com",
|
|
2783
|
-
SHAR: "Sharp Laboratories",
|
|
2784
|
-
SICC: "International Color Consortium",
|
|
2785
|
-
SONY: "Sony",
|
|
2786
|
-
SPCL: "SpectraCal",
|
|
2787
|
-
STAR: "Star",
|
|
2788
|
-
STC: "Sampo Technology",
|
|
2789
|
-
Scit: "Scitex",
|
|
2790
|
-
Sdp: "Scitex",
|
|
2791
|
-
Sony: "Sony",
|
|
2792
|
-
TALO: "Talon Technology",
|
|
2793
|
-
TAND: "Tandy",
|
|
2794
|
-
TATU: "Tatung",
|
|
2795
|
-
TAXA: "TAXAN America",
|
|
2796
|
-
TDS: "Tokyo Denshi Sekei",
|
|
2797
|
-
TECO: "TECO Information Systems",
|
|
2798
|
-
TEGR: "Tegra",
|
|
2799
|
-
TEKT: "Tektronix",
|
|
2800
|
-
TI: "Texas Instruments",
|
|
2801
|
-
TMKR: "TypeMaker",
|
|
2802
|
-
TOSB: "Toshiba",
|
|
2803
|
-
TOSH: "Toshiba",
|
|
2804
|
-
TOTK: "TOTOKU ELECTRIC",
|
|
2805
|
-
TRIU: "Triumph",
|
|
2806
|
-
TSBT: "Toshiba",
|
|
2807
|
-
TTX: "TTX Computer Products",
|
|
2808
|
-
TVM: "TVM Professional Monitor",
|
|
2809
|
-
TW: "TW Casper",
|
|
2810
|
-
ULSX: "Ulead Systems",
|
|
2811
|
-
UNIS: "Unisys",
|
|
2812
|
-
UTZF: "Utz Fehlau & Sohn",
|
|
2813
|
-
VARI: "Varityper",
|
|
2814
|
-
VIEW: "Viewsonic",
|
|
2815
|
-
VISL: "Visual communication",
|
|
2816
|
-
VIVO: "Vivo Mobile Communication",
|
|
2817
|
-
WANG: "Wang",
|
|
2818
|
-
WLBR: "Wilbur Imaging",
|
|
2819
|
-
WTG2: "Ware To Go",
|
|
2820
|
-
WYSE: "WYSE Technology",
|
|
2821
|
-
XERX: "Xerox",
|
|
2822
|
-
XRIT: "X-Rite",
|
|
2823
|
-
ZRAN: "Zoran",
|
|
2824
|
-
Zebr: "Zebra Technologies",
|
|
2825
|
-
appl: "Apple Computer",
|
|
2826
|
-
bICC: "basICColor",
|
|
2827
|
-
berg: "bergdesign",
|
|
2828
|
-
ceyd: "Integrated Color Solutions",
|
|
2829
|
-
clsp: "MacDermid ColorSpan",
|
|
2830
|
-
ds: "Dainippon Screen",
|
|
2831
|
-
dupn: "DuPont",
|
|
2832
|
-
ffei: "FujiFilm Electronic Imaging",
|
|
2833
|
-
flux: "FluxData",
|
|
2834
|
-
iris: "Scitex",
|
|
2835
|
-
kart: "Scitex",
|
|
2836
|
-
lcms: "Little CMS",
|
|
2837
|
-
lino: "Linotronic",
|
|
2838
|
-
none: "none",
|
|
2839
|
-
ob4d: "Erdt Systems",
|
|
2840
|
-
obic: "Medigraph",
|
|
2841
|
-
quby: "Qubyx Sarl",
|
|
2842
|
-
scit: "Scitex",
|
|
2843
|
-
scrn: "Dainippon Screen",
|
|
2844
|
-
sdp: "Scitex",
|
|
2845
|
-
siwi: "SIWI GRAFIKA",
|
|
2846
|
-
yxym: "YxyMaster"
|
|
2847
|
-
}, Ut = {
|
|
2848
|
-
scnr: "Scanner",
|
|
2849
|
-
mntr: "Monitor",
|
|
2850
|
-
prtr: "Printer",
|
|
2851
|
-
link: "Device Link",
|
|
2852
|
-
abst: "Abstract",
|
|
2853
|
-
spac: "Color Space Conversion Profile",
|
|
2854
|
-
nmcl: "Named Color",
|
|
2855
|
-
cenc: "ColorEncodingSpace profile",
|
|
2856
|
-
mid: "MultiplexIdentification profile",
|
|
2857
|
-
mlnk: "MultiplexLink profile",
|
|
2858
|
-
mvis: "MultiplexVisualization profile",
|
|
2859
|
-
nkpf: "Nikon Input Device Profile (NON-STANDARD!)"
|
|
2860
|
-
};
|
|
2861
|
-
B(G, "icc", [
|
|
2862
|
-
[4, Lt],
|
|
2863
|
-
[12, Ut],
|
|
2864
|
-
[40, Object.assign({}, Lt, Ut)],
|
|
2865
|
-
[48, Lt],
|
|
2866
|
-
[80, Lt],
|
|
2867
|
-
[64, {
|
|
2868
|
-
0: "Perceptual",
|
|
2869
|
-
1: "Relative Colorimetric",
|
|
2870
|
-
2: "Saturation",
|
|
2871
|
-
3: "Absolute Colorimetric"
|
|
2872
|
-
}],
|
|
2873
|
-
["tech", {
|
|
2874
|
-
amd: "Active Matrix Display",
|
|
2875
|
-
crt: "Cathode Ray Tube Display",
|
|
2876
|
-
kpcd: "Photo CD",
|
|
2877
|
-
pmd: "Passive Matrix Display",
|
|
2878
|
-
dcam: "Digital Camera",
|
|
2879
|
-
dcpj: "Digital Cinema Projector",
|
|
2880
|
-
dmpc: "Digital Motion Picture Camera",
|
|
2881
|
-
dsub: "Dye Sublimation Printer",
|
|
2882
|
-
epho: "Electrophotographic Printer",
|
|
2883
|
-
esta: "Electrostatic Printer",
|
|
2884
|
-
flex: "Flexography",
|
|
2885
|
-
fprn: "Film Writer",
|
|
2886
|
-
fscn: "Film Scanner",
|
|
2887
|
-
grav: "Gravure",
|
|
2888
|
-
ijet: "Ink Jet Printer",
|
|
2889
|
-
imgs: "Photo Image Setter",
|
|
2890
|
-
mpfr: "Motion Picture Film Recorder",
|
|
2891
|
-
mpfs: "Motion Picture Film Scanner",
|
|
2892
|
-
offs: "Offset Lithography",
|
|
2893
|
-
pjtv: "Projection Television",
|
|
2894
|
-
rpho: "Photographic Paper Printer",
|
|
2895
|
-
rscn: "Reflective Scanner",
|
|
2896
|
-
silk: "Silkscreen",
|
|
2897
|
-
twax: "Thermal Wax Printer",
|
|
2898
|
-
vidc: "Video Camera",
|
|
2899
|
-
vidm: "Video Monitor"
|
|
2900
|
-
}]
|
|
2901
|
-
]);
|
|
2902
|
-
class Ft extends ge {
|
|
2903
|
-
static canHandle(e, t, i) {
|
|
2904
|
-
return 237 === e.getUint8(t + 1) && "Photoshop" === e.getString(t + 4, 9) && void 0 !== this.containsIptc8bim(e, t, i);
|
|
2905
|
-
}
|
|
2906
|
-
static headerLength(e, t, i) {
|
|
2907
|
-
let n, s = this.containsIptc8bim(e, t, i);
|
|
2908
|
-
if (void 0 !== s) return n = e.getUint8(t + s + 7), n % 2 != 0 && (n += 1), 0 === n && (n = 4), s + 8 + n;
|
|
2909
|
-
}
|
|
2910
|
-
static containsIptc8bim(e, t, i) {
|
|
2911
|
-
for (let n = 0; n < i; n++) if (this.isIptcSegmentHead(e, t + n)) return n;
|
|
2912
|
-
}
|
|
2913
|
-
static isIptcSegmentHead(e, t) {
|
|
2914
|
-
return 56 === e.getUint8(t) && 943868237 === e.getUint32(t) && 1028 === e.getUint16(t + 4);
|
|
2915
|
-
}
|
|
2916
|
-
parse() {
|
|
2917
|
-
let { raw: e } = this, t = this.chunk.byteLength - 1, i = !1;
|
|
2918
|
-
for (let n = 0; n < t; n++) if (28 === this.chunk.getUint8(n) && 2 === this.chunk.getUint8(n + 1)) {
|
|
2919
|
-
i = !0;
|
|
2920
|
-
let t = this.chunk.getUint16(n + 3), s = this.chunk.getUint8(n + 2), r = this.chunk.getLatin1String(n + 5, t);
|
|
2921
|
-
e.set(s, this.pluralizeValue(e.get(s), r)), n += 4 + t;
|
|
2922
|
-
} else if (i) break;
|
|
2923
|
-
return this.translate(), this.output;
|
|
2924
|
-
}
|
|
2925
|
-
pluralizeValue(e, t) {
|
|
2926
|
-
return void 0 !== e ? e instanceof Array ? (e.push(t), e) : [e, t] : t;
|
|
2927
|
-
}
|
|
2928
|
-
}
|
|
2929
|
-
f(Ft, "type", "iptc"), f(Ft, "translateValues", !1), f(Ft, "reviveValues", !1), A.set("iptc", Ft), B(N, "iptc", [
|
|
2930
|
-
[0, "ApplicationRecordVersion"],
|
|
2931
|
-
[3, "ObjectTypeReference"],
|
|
2932
|
-
[4, "ObjectAttributeReference"],
|
|
2933
|
-
[5, "ObjectName"],
|
|
2934
|
-
[7, "EditStatus"],
|
|
2935
|
-
[8, "EditorialUpdate"],
|
|
2936
|
-
[10, "Urgency"],
|
|
2937
|
-
[12, "SubjectReference"],
|
|
2938
|
-
[15, "Category"],
|
|
2939
|
-
[20, "SupplementalCategories"],
|
|
2940
|
-
[22, "FixtureIdentifier"],
|
|
2941
|
-
[25, "Keywords"],
|
|
2942
|
-
[26, "ContentLocationCode"],
|
|
2943
|
-
[27, "ContentLocationName"],
|
|
2944
|
-
[30, "ReleaseDate"],
|
|
2945
|
-
[35, "ReleaseTime"],
|
|
2946
|
-
[37, "ExpirationDate"],
|
|
2947
|
-
[38, "ExpirationTime"],
|
|
2948
|
-
[40, "SpecialInstructions"],
|
|
2949
|
-
[42, "ActionAdvised"],
|
|
2950
|
-
[45, "ReferenceService"],
|
|
2951
|
-
[47, "ReferenceDate"],
|
|
2952
|
-
[50, "ReferenceNumber"],
|
|
2953
|
-
[55, "DateCreated"],
|
|
2954
|
-
[60, "TimeCreated"],
|
|
2955
|
-
[62, "DigitalCreationDate"],
|
|
2956
|
-
[63, "DigitalCreationTime"],
|
|
2957
|
-
[65, "OriginatingProgram"],
|
|
2958
|
-
[70, "ProgramVersion"],
|
|
2959
|
-
[75, "ObjectCycle"],
|
|
2960
|
-
[80, "Byline"],
|
|
2961
|
-
[85, "BylineTitle"],
|
|
2962
|
-
[90, "City"],
|
|
2963
|
-
[92, "Sublocation"],
|
|
2964
|
-
[95, "State"],
|
|
2965
|
-
[100, "CountryCode"],
|
|
2966
|
-
[101, "Country"],
|
|
2967
|
-
[103, "OriginalTransmissionReference"],
|
|
2968
|
-
[105, "Headline"],
|
|
2969
|
-
[110, "Credit"],
|
|
2970
|
-
[115, "Source"],
|
|
2971
|
-
[116, "CopyrightNotice"],
|
|
2972
|
-
[118, "Contact"],
|
|
2973
|
-
[120, "Caption"],
|
|
2974
|
-
[121, "LocalCaption"],
|
|
2975
|
-
[122, "Writer"],
|
|
2976
|
-
[125, "RasterizedCaption"],
|
|
2977
|
-
[130, "ImageType"],
|
|
2978
|
-
[131, "ImageOrientation"],
|
|
2979
|
-
[135, "LanguageIdentifier"],
|
|
2980
|
-
[150, "AudioType"],
|
|
2981
|
-
[151, "AudioSamplingRate"],
|
|
2982
|
-
[152, "AudioSamplingResolution"],
|
|
2983
|
-
[153, "AudioDuration"],
|
|
2984
|
-
[154, "AudioOutcue"],
|
|
2985
|
-
[184, "JobID"],
|
|
2986
|
-
[185, "MasterDocumentID"],
|
|
2987
|
-
[186, "ShortDocumentID"],
|
|
2988
|
-
[187, "UniqueDocumentID"],
|
|
2989
|
-
[188, "OwnerID"],
|
|
2990
|
-
[200, "ObjectPreviewFileFormat"],
|
|
2991
|
-
[201, "ObjectPreviewFileVersion"],
|
|
2992
|
-
[202, "ObjectPreviewData"],
|
|
2993
|
-
[221, "Prefs"],
|
|
2994
|
-
[225, "ClassifyState"],
|
|
2995
|
-
[228, "SimilarityIndex"],
|
|
2996
|
-
[230, "DocumentNotes"],
|
|
2997
|
-
[231, "DocumentHistory"],
|
|
2998
|
-
[232, "ExifCameraInfo"],
|
|
2999
|
-
[255, "CatalogSets"]
|
|
3000
|
-
]), B(G, "iptc", [
|
|
3001
|
-
[10, {
|
|
3002
|
-
0: "0 (reserved)",
|
|
3003
|
-
1: "1 (most urgent)",
|
|
3004
|
-
2: "2",
|
|
3005
|
-
3: "3",
|
|
3006
|
-
4: "4",
|
|
3007
|
-
5: "5 (normal urgency)",
|
|
3008
|
-
6: "6",
|
|
3009
|
-
7: "7",
|
|
3010
|
-
8: "8 (least urgent)",
|
|
3011
|
-
9: "9 (user-defined priority)"
|
|
3012
|
-
}],
|
|
3013
|
-
[75, {
|
|
3014
|
-
a: "Morning",
|
|
3015
|
-
b: "Both Morning and Evening",
|
|
3016
|
-
p: "Evening"
|
|
3017
|
-
}],
|
|
3018
|
-
[131, {
|
|
3019
|
-
L: "Landscape",
|
|
3020
|
-
P: "Portrait",
|
|
3021
|
-
S: "Square"
|
|
3022
|
-
}]
|
|
3023
|
-
]), e.Exifr = ce, e.Options = oe, e.allFormatters = ie, e.chunkedProps = $, e.createDictionary = B, e.default = ft, e.extendDictionary = E, e.fetchUrlAsArrayBuffer = L, e.fileParsers = T, e.fileReaders = D, e.gps = De, e.gpsOnlyOptions = Ae, e.inheritables = te, e.orientation = Re, e.orientationOnlyOptions = Me, e.otherSegments = J, e.parse = fe, e.readBlobAsArrayBuffer = U, e.rotation = Ue, e.rotations = Le, e.segmentParsers = A, e.segments = q, e.segmentsAndBlocks = Z, e.sidecar = async function(e, t, i) {
|
|
3024
|
-
let n = new oe(t);
|
|
3025
|
-
n.chunked = !1, void 0 === i && "string" == typeof e && (i = function(e) {
|
|
3026
|
-
let t = e.toLowerCase().split(".").pop();
|
|
3027
|
-
if (function(e) {
|
|
3028
|
-
return "exif" === e || "tiff" === e || "tif" === e;
|
|
3029
|
-
}(t)) return "tiff";
|
|
3030
|
-
if (dt.includes(t)) return t;
|
|
3031
|
-
}(e));
|
|
3032
|
-
let s = await x(e, n);
|
|
3033
|
-
if (i) {
|
|
3034
|
-
if (dt.includes(i)) return gt(i, s, n);
|
|
3035
|
-
m("Invalid segment type");
|
|
3036
|
-
} else {
|
|
3037
|
-
if (function(e) {
|
|
3038
|
-
let t = e.getString(0, 50).trim();
|
|
3039
|
-
return t.includes("<?xpacket") || t.includes("<x:");
|
|
3040
|
-
}(s)) return gt("xmp", s, n);
|
|
3041
|
-
for (let [e] of A) {
|
|
3042
|
-
if (!dt.includes(e)) continue;
|
|
3043
|
-
let t = await gt(e, s, n).catch(pt);
|
|
3044
|
-
if (t) return t;
|
|
3045
|
-
}
|
|
3046
|
-
m("Unknown file format");
|
|
3047
|
-
}
|
|
3048
|
-
}, e.tagKeys = N, e.tagRevivers = V, e.tagValues = G, e.thumbnail = xe, e.thumbnailOnlyOptions = Oe, e.thumbnailUrl = ve, e.tiffBlocks = Q, e.tiffExtractables = ee, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
3049
|
-
}));
|
|
3050
|
-
}));
|
|
3051
|
-
//#endregion
|
|
3052
|
-
export default require_full_umd();
|
|
3053
|
-
export {};
|
|
3054
|
-
|
|
3055
|
-
//# sourceMappingURL=full.umd-oM1VUBRH.mjs.map
|