@hussmartinez/image-sdk 0.2.0 → 0.3.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.
@@ -1,4 +1,4 @@
1
- import { SdkError, applyCommands, coreLimits, createErrorHelpers, createHistory, createStore, createWorkerClient, defineLimits, defineMessages, isSdkError, plural, resolveAssetsBase, sdkCoreMessages } from "@hussmartinez/sdk-core";
1
+ import { SdkError, applyCommands, coreLimits, createAssetsResolver, createErrorHelpers, createHistory, createStore, createWorkerClient, defineLimits, defineMessages, isSdkError, plural, sdkCoreMessages, withProcessingTime } from "@hussmartinez/sdk-core";
2
2
  import { uiMessages } from "@hussmartinez/ui";
3
3
  // src/core/errors/image-error.ts
4
4
  var ImageError = class extends SdkError {
@@ -73,78 +73,200 @@ function checkOutputLimits(policy, size) {
73
73
  policy.check("maxImageDimension", Math.max(size.width, size.height));
74
74
  policy.check("maxImagePixels", size.width * size.height);
75
75
  }
76
+ // src/adapters/worker-lifecycle.ts
77
+ function createWorkerLifecycle(clearSources, submitted) {
78
+ let current;
79
+ let sequence = 0;
80
+ let terminal = false;
81
+ let destroyed = false;
82
+ const listeners = /* @__PURE__ */ new Set();
83
+ const invalidated = () => new ImageError("WORKER_TERMINATED", "Recreate the image engine before reopening the image.", { details: { reason: "engine-invalidated" } });
84
+ const check = (generation) => {
85
+ if (destroyed) throw new Error("The image engine has been destroyed.");
86
+ if (terminal || generation && (generation.closed || generation !== current)) throw invalidated();
87
+ };
88
+ return {
89
+ check,
90
+ current: () => current,
91
+ getSnapshot: () => terminal,
92
+ subscribe(listener) {
93
+ const notify = () => listener();
94
+ listeners.add(notify);
95
+ return () => {
96
+ listeners.delete(notify);
97
+ };
98
+ },
99
+ destroy() {
100
+ destroyed = true;
101
+ listeners.clear();
102
+ clearSources();
103
+ },
104
+ wrap(worker) {
105
+ check();
106
+ const generation = {
107
+ number: ++sequence,
108
+ closed: false,
109
+ ownsResources: false
110
+ };
111
+ current = generation;
112
+ return {
113
+ postMessage(message, transfer) {
114
+ check(generation);
115
+ const call = message;
116
+ if (call?.type === "call" && (call.method === "register" || call.method === "attachCanvas")) generation.ownsResources = true;
117
+ if (call?.type === "call" && call.method === "register" && typeof call.input?.id === "string") submitted(call.input.id, generation);
118
+ worker.postMessage(message, transfer);
119
+ },
120
+ addEventListener(type, listener) {
121
+ worker.addEventListener(type, listener);
122
+ },
123
+ removeEventListener(type, listener) {
124
+ worker.removeEventListener(type, listener);
125
+ },
126
+ terminate() {
127
+ if (generation.closed) return;
128
+ generation.closed = true;
129
+ try {
130
+ if (current !== generation) return;
131
+ clearSources();
132
+ if (destroyed || !generation.ownsResources || terminal) return;
133
+ terminal = true;
134
+ const notified = [...listeners];
135
+ queueMicrotask(() => {
136
+ if (destroyed) return;
137
+ for (const listener of notified) {
138
+ if (!listeners.has(listener)) continue;
139
+ try {
140
+ listener();
141
+ } catch {}
142
+ }
143
+ });
144
+ } finally {
145
+ worker.terminate();
146
+ }
147
+ }
148
+ };
149
+ }
150
+ };
151
+ }
152
+ function closeRejectedResult(value) {
153
+ if (value && typeof value === "object" && "close" in value && typeof value.close === "function") try {
154
+ value.close();
155
+ } catch {}
156
+ }
76
157
  // src/adapters/image-engine.ts
77
158
  var ENGINE_INTERNALS = Symbol("hm-image-engine");
78
159
  function engineInternals(engine) {
79
160
  return engine[ENGINE_INTERNALS];
80
161
  }
81
162
  function createImageEngine(options = {}) {
82
- const base = options.assetsUrl === void 0 ? void 0 : resolveAssetsBase(options.assetsUrl);
83
- const selfHosted = base === void 0 ? void 0 : `${base}image/render.worker.js`;
163
+ const asset = options.assetsUrl === void 0 ? void 0 : createAssetsResolver(options.assetsUrl);
164
+ let workerUrl;
84
165
  return createEngine({
85
- loadWorker: selfHosted ? async () => () => new Worker(selfHosted, {
86
- type: "module",
87
- name: "hm-image-render"
88
- }) : async () => (await import("../lazy/inline-worker-Cvw0Gpxf.js")).createInlineWorker,
89
- version: "0.2.0",
90
- ...selfHosted ? { asset: selfHosted } : {}
166
+ loadWorker: asset ? async () => () => {
167
+ workerUrl = asset("image/render.worker.js");
168
+ return new Worker(workerUrl, {
169
+ type: "module",
170
+ name: "hm-image-render"
171
+ });
172
+ } : async () => (await import("../lazy/inline-worker-l_ynDNuS.js")).createInlineWorker,
173
+ version: "0.3.0",
174
+ get asset() {
175
+ return workerUrl ?? "inline";
176
+ }
91
177
  });
92
178
  }
93
179
  function createEngine(environment) {
94
180
  let startWorker;
95
181
  let destroyed = false;
96
- const ids = /* @__PURE__ */ new Set();
182
+ const ids = /* @__PURE__ */ new Map();
183
+ const lifecycle = createWorkerLifecycle(() => ids.clear(), (id, generation) => {
184
+ const reservation = ids.get(id);
185
+ if (reservation) reservation.generation = generation;
186
+ });
97
187
  const client = createWorkerClient({
98
188
  createWorker: () => {
99
189
  if (!startWorker) throw new ImageError("WORKER_START_FAILED", "The render worker hasn't loaded.");
100
- return startWorker();
190
+ return lifecycle.wrap(startWorker());
101
191
  },
102
192
  errorClasses: { ImageError },
103
193
  idleTimeout: 0,
104
194
  cancelTimeout: 3e4,
105
- onCrash: () => ids.clear(),
106
195
  packageVersion: environment.version,
107
- workerAsset: environment.asset ?? "inline"
196
+ get workerAsset() {
197
+ return environment.asset ?? "inline";
198
+ }
108
199
  });
109
200
  async function ready() {
110
201
  if (destroyed) throw new Error("The image engine has been destroyed.");
111
202
  startWorker ??= await environment.loadWorker();
112
203
  }
113
- async function run(signal, work) {
114
- throwIfAborted(signal);
204
+ const call = async (method, input, options) => {
205
+ lifecycle.check();
206
+ throwIfAborted(options?.signal);
207
+ await ready();
208
+ lifecycle.check();
209
+ const pending = client.call(method, input, options);
210
+ const generation = lifecycle.current();
211
+ const result = await pending.catch((error) => {
212
+ throw error instanceof TypeError ? error : asImageError(error);
213
+ });
214
+ try {
215
+ lifecycle.check(generation);
216
+ } catch (error) {
217
+ closeRejectedResult(result);
218
+ throw error;
219
+ }
220
+ return result;
221
+ };
222
+ const prepare = async () => {
223
+ lifecycle.check();
224
+ await ready();
225
+ lifecycle.check();
226
+ const pending = client.start();
227
+ const generation = lifecycle.current();
115
228
  try {
116
- await ready();
117
- return await work();
229
+ await pending;
118
230
  } catch (error) {
119
- if (error instanceof TypeError) throw error;
120
- if (signal?.aborted) throw abortError(signal);
121
231
  throw asImageError(error);
122
232
  }
123
- }
233
+ lifecycle.check(generation);
234
+ if (!generation) throw new Error("The worker did not create a generation.");
235
+ return generation;
236
+ };
124
237
  const callOptions = (options) => options?.signal ? { signal: options.signal } : {};
125
238
  return {
126
239
  [ENGINE_INTERNALS]: {
127
- client: async () => {
128
- await ready();
129
- return client;
130
- },
131
- has: (id) => ids.has(id)
240
+ call,
241
+ prepare,
242
+ check: lifecycle.check,
243
+ getSnapshot: lifecycle.getSnapshot,
244
+ subscribe: lifecycle.subscribe,
245
+ has: (id) => ids.get(id)?.registered === true
132
246
  },
133
247
  probe(file, options) {
134
- return run(options?.signal, () => client.call("probe", { file }, callOptions(options)));
248
+ return call("probe", { file }, callOptions(options));
135
249
  },
136
250
  async register(id, file, probe, options) {
137
- if (destroyed) throw new Error("The image engine has been destroyed.");
251
+ lifecycle.check();
138
252
  if (ids.has(id)) throw new TypeError(`The source id "${id}" is already in use.`);
139
- ids.add(id);
253
+ const reservation = {
254
+ registered: false,
255
+ released: false
256
+ };
257
+ ids.set(id, reservation);
140
258
  try {
141
- const size = await run(options?.signal, () => client.call("register", {
259
+ const size = await call("register", {
142
260
  id,
143
261
  file,
144
262
  probe,
145
263
  limits: Object.fromEntries(PER_FILE_LIMITS.map((limit) => [limit, (options?.filePolicy ?? imageLimits.resolve()).limits[limit].maximum]))
146
- }, callOptions(options)));
264
+ }, callOptions(options));
265
+ lifecycle.check(reservation.generation);
266
+ if (reservation.released) throw new TypeError("The source was released during registration.");
267
+ reservation.registered = true;
147
268
  options?.onProgress?.(1);
269
+ lifecycle.check(reservation.generation);
148
270
  return {
149
271
  id,
150
272
  format: probe.format,
@@ -155,27 +277,35 @@ function createEngine(environment) {
155
277
  decodedBytes: size.width * size.height * 4
156
278
  };
157
279
  } catch (error) {
158
- ids.delete(id);
159
- if (options?.signal?.aborted && !destroyed) client.call("release", { id }).catch(() => void 0);
280
+ if (ids.get(id) === reservation) ids.delete(id);
281
+ if ((options?.signal?.aborted || reservation.released) && reservation.generation && !reservation.generation.closed && !destroyed && !lifecycle.getSnapshot()) call("release", { id }).catch(() => void 0);
160
282
  throw error;
161
283
  }
162
284
  },
163
285
  async thumbnail(id, maxSize, options) {
164
- if (!ids.has(id)) throw new TypeError(`There's no source with the id "${id}".`);
286
+ lifecycle.check();
287
+ if (!ids.get(id)?.registered) throw new TypeError(`There's no source with the id "${id}".`);
165
288
  if (!(maxSize >= 1)) throw new RangeError("maxSize must be at least 1.");
166
- return run(options?.signal, () => client.call("thumbnail", {
289
+ return call("thumbnail", {
167
290
  id,
168
291
  maxSize
169
- }, callOptions(options)));
292
+ }, callOptions(options));
170
293
  },
171
294
  async release(id) {
172
- if (!ids.delete(id) || destroyed) return;
173
- await run(void 0, () => client.call("release", { id }));
295
+ const reservation = ids.get(id);
296
+ if (!reservation) return;
297
+ if (!reservation.registered) {
298
+ reservation.released = true;
299
+ return;
300
+ }
301
+ ids.delete(id);
302
+ if (destroyed || lifecycle.getSnapshot() || reservation.generation?.closed) return;
303
+ await call("release", { id });
174
304
  },
175
305
  async destroy() {
176
306
  if (destroyed) return;
177
307
  destroyed = true;
178
- ids.clear();
308
+ lifecycle.destroy();
179
309
  client.destroy();
180
310
  }
181
311
  };
@@ -198,21 +328,22 @@ function createImageProcessor(engine) {
198
328
  if (format.type !== "png" && format.quality !== void 0) {
199
329
  if (!(format.quality >= 0 && format.quality <= 1)) throw new RangeError("quality must be from 0 to 1.");
200
330
  }
331
+ internals.check();
201
332
  if (!internals.has(plan.base.source)) throw new TypeError(`There's no source with the id "${plan.base.source}".`);
202
333
  const signal = options?.signal;
203
334
  throwIfAborted(signal);
204
335
  const policy = options?.filePolicy ?? imageLimits.resolve();
205
336
  try {
206
- const blob = await (await internals.client()).call("export", {
337
+ const blob = await internals.call("export", {
207
338
  plan,
208
339
  format,
209
340
  limits: Object.fromEntries(OUTPUT_LIMITS.map((limit) => [limit, policy.limits[limit].maximum]))
210
341
  }, signal ? { signal } : {});
211
342
  options?.onProgress?.(1);
343
+ internals.check();
212
344
  return blob;
213
345
  } catch (error) {
214
346
  if (error instanceof TypeError) throw error;
215
- if (signal?.aborted) throw abortError(signal);
216
347
  throw asImageError(error);
217
348
  }
218
349
  },
@@ -281,17 +412,22 @@ function createImageRenderer(engine) {
281
412
  const onAbort = () => controller.abort(request.signal?.reason);
282
413
  request.signal?.addEventListener("abort", onAbort, { once: true });
283
414
  inFlight = { controller };
284
- internals.client().then((client) => client.call("render", {
415
+ internals.call("render", {
285
416
  id,
286
417
  plan: request.plan,
287
418
  view: request.view,
288
419
  limits: request.limits
289
- }, { signal: controller.signal })).then(() => {
420
+ }, { signal: controller.signal }).then(() => {
421
+ try {
422
+ internals.check();
423
+ } catch (error) {
424
+ request.reject(error);
425
+ return;
426
+ }
290
427
  drawn += 1;
291
428
  request.resolve("drawn");
292
429
  }, (error) => {
293
- if (request.signal?.aborted) request.reject(abortError(request.signal));
294
- else if (controller.signal.aborted) request.resolve("superseded");
430
+ if (!internals.getSnapshot() && controller.signal.aborted && !request.signal?.aborted && isImageError(error, "ABORTED")) request.resolve("superseded");
295
431
  else request.reject(error instanceof TypeError ? error : asImageError(error));
296
432
  }).finally(() => {
297
433
  request.signal?.removeEventListener("abort", onAbort);
@@ -301,19 +437,28 @@ function createImageRenderer(engine) {
301
437
  };
302
438
  return {
303
439
  [RENDERER_INTERNALS]: {
304
- snapshot: async () => (await internals.client()).call("snapshot", { id }),
440
+ snapshot: async () => internals.call("snapshot", { id }),
305
441
  drawn: () => drawn
306
442
  },
307
443
  async attach(canvas) {
308
444
  if (destroyed) throw new Error("The image renderer has been destroyed.");
445
+ internals.check();
309
446
  if (attached) throw new TypeError("The renderer already has a canvas.");
310
447
  if (typeof canvas.transferControlToOffscreen !== "function") throw new ImageError("UNSUPPORTED_ENVIRONMENT", "This browser can't draw the preview in a worker.", { details: { feature: "transferControlToOffscreen" } });
311
- const offscreen = canvas.transferControlToOffscreen();
312
448
  try {
313
- await (await internals.client()).call("attachCanvas", {
449
+ const generation = await internals.prepare();
450
+ internals.check(generation);
451
+ if (destroyed) throw new Error("The image renderer has been destroyed.");
452
+ const offscreen = canvas.transferControlToOffscreen();
453
+ await internals.call("attachCanvas", {
314
454
  id,
315
455
  canvas: offscreen
316
456
  }, { transfer: true });
457
+ internals.check(generation);
458
+ if (destroyed) {
459
+ await internals.call("detachCanvas", { id });
460
+ throw new Error("The image renderer has been destroyed.");
461
+ }
317
462
  attached = true;
318
463
  } catch (error) {
319
464
  throw asImageError(error);
@@ -321,6 +466,11 @@ function createImageRenderer(engine) {
321
466
  },
322
467
  render(plan, view, options) {
323
468
  if (destroyed) return Promise.reject(/* @__PURE__ */ new Error("The image renderer has been destroyed."));
469
+ try {
470
+ internals.check();
471
+ } catch (error) {
472
+ return Promise.reject(error);
473
+ }
324
474
  if (!attached) return Promise.reject(/* @__PURE__ */ new TypeError("Attach a canvas before rendering."));
325
475
  if (!internals.has(plan.base.source)) return Promise.reject(/* @__PURE__ */ new TypeError(`There's no source with the id "${plan.base.source}".`));
326
476
  const policy = options?.filePolicy ?? imageLimits.resolve();
@@ -349,11 +499,16 @@ function createImageRenderer(engine) {
349
499
  async destroy() {
350
500
  if (destroyed) return;
351
501
  destroyed = true;
352
- pending?.resolve("superseded");
502
+ if (pending) try {
503
+ internals.check();
504
+ pending.resolve("superseded");
505
+ } catch (error) {
506
+ pending.reject(error);
507
+ }
353
508
  pending = void 0;
354
509
  inFlight?.controller.abort(new DOMException("The renderer was destroyed.", "AbortError"));
355
- if (attached) try {
356
- await (await internals.client()).call("detachCanvas", { id });
510
+ if (attached && !internals.getSnapshot()) try {
511
+ await internals.call("detachCanvas", { id });
357
512
  } catch {}
358
513
  }
359
514
  };
@@ -1040,13 +1195,13 @@ function createImageSession(options) {
1040
1195
  let nextId = 0;
1041
1196
  let destroyed = false;
1042
1197
  const snapshot = () => ({
1043
- status: plan !== null ? "ready" : opening > 0 ? "opening" : "empty",
1198
+ status: plan !== null ? "ready" : !destroyed && opening > 0 ? "opening" : "empty",
1044
1199
  plan,
1045
1200
  source,
1046
1201
  canUndo: history.canUndo,
1047
1202
  canRedo: history.canRedo,
1048
- opening: opening > 0,
1049
- exporting: exporting > 0,
1203
+ opening: !destroyed && opening > 0,
1204
+ exporting: !destroyed && exporting > 0,
1050
1205
  warnings,
1051
1206
  error
1052
1207
  });
@@ -1132,7 +1287,6 @@ function createImageSession(options) {
1132
1287
  subscribe: (listener) => store.subscribe(listener),
1133
1288
  async open(file, openOptions = {}) {
1134
1289
  assertAlive();
1135
- const { signal } = openOptions;
1136
1290
  opens += 1;
1137
1291
  const ticket = opens;
1138
1292
  nextId += 1;
@@ -1141,17 +1295,25 @@ function createImageSession(options) {
1141
1295
  opening += 1;
1142
1296
  publish();
1143
1297
  try {
1144
- throwIfAborted(signal);
1145
- policy.check("maxFileSize", file.size);
1146
- const probe = await engine.probe(file, signal ? { signal } : {});
1147
- const near = checkSource(policy, file, probe);
1148
- if (ticket !== opens) throw superseded();
1149
- const info = await engine.register(id, file, probe, {
1150
- filePolicy: policy,
1151
- ...signal ? { signal } : {}
1152
- });
1153
- registered = true;
1154
- throwIfAborted(signal);
1298
+ const { probe, near, info } = await withProcessingTime(policy, async (signal) => {
1299
+ throwIfAborted(signal);
1300
+ policy.check("maxFileSize", file.size);
1301
+ const probe = await engine.probe(file, { signal });
1302
+ throwIfAborted(signal);
1303
+ const near = checkSource(policy, file, probe);
1304
+ if (ticket !== opens) throw superseded();
1305
+ const info = await engine.register(id, file, probe, {
1306
+ filePolicy: policy,
1307
+ signal
1308
+ });
1309
+ registered = true;
1310
+ throwIfAborted(signal);
1311
+ return {
1312
+ probe,
1313
+ near,
1314
+ info
1315
+ };
1316
+ }, openOptions);
1155
1317
  assertAlive();
1156
1318
  if (ticket !== opens) throw superseded();
1157
1319
  const previous = source;
@@ -1177,7 +1339,7 @@ function createImageSession(options) {
1177
1339
  if (registered && source?.id !== id) await engine.release(id).catch(() => {});
1178
1340
  const failure = isImageError(reason) ? reason : asImageError(reason);
1179
1341
  const cancelled = failure.code === "ABORTED";
1180
- if (!cancelled) fail(failure);
1342
+ if (!cancelled && !destroyed && ticket === opens) fail(failure);
1181
1343
  emit({
1182
1344
  type: "open",
1183
1345
  outcome: cancelled ? "cancelled" : "failed",
@@ -1186,7 +1348,7 @@ function createImageSession(options) {
1186
1348
  throw failure;
1187
1349
  } finally {
1188
1350
  opening -= 1;
1189
- publish();
1351
+ if (!destroyed) publish();
1190
1352
  }
1191
1353
  },
1192
1354
  execute: (input) => executeCommands(input),
@@ -1209,7 +1371,7 @@ function createImageSession(options) {
1209
1371
  redo: () => replay("redo"),
1210
1372
  async export(format, exportOptions = {}) {
1211
1373
  assertAlive();
1212
- const { signal, onProgress } = exportOptions;
1374
+ const { onProgress } = exportOptions;
1213
1375
  if (plan === null || source === null) throw new ImageError("INVALID_COMMAND", "There's nothing to export before a file is open.");
1214
1376
  const started = generation;
1215
1377
  const exported = plan;
@@ -1218,14 +1380,19 @@ function createImageSession(options) {
1218
1380
  publish();
1219
1381
  try {
1220
1382
  const size = outputSize(exported.output, compositionSize(exported, from));
1221
- const blob = await processor.export({
1222
- plan: exported,
1223
- format
1224
- }, {
1225
- filePolicy: policy,
1226
- ...signal ? { signal } : {},
1227
- ...onProgress ? { onProgress } : {}
1228
- });
1383
+ const blob = await withProcessingTime(policy, async (signal) => {
1384
+ throwIfAborted(signal);
1385
+ const blob = await processor.export({
1386
+ plan: exported,
1387
+ format
1388
+ }, {
1389
+ filePolicy: policy,
1390
+ signal,
1391
+ ...onProgress ? { onProgress } : {}
1392
+ });
1393
+ throwIfAborted(signal);
1394
+ return blob;
1395
+ }, exportOptions);
1229
1396
  if (started !== generation || destroyed) throw new ImageError("ABORTED", "Another file was opened during the export.", { details: { reason: "superseded" } });
1230
1397
  error = null;
1231
1398
  emit({
@@ -1243,7 +1410,7 @@ function createImageSession(options) {
1243
1410
  } catch (reason) {
1244
1411
  const failure = isImageError(reason) ? reason : asImageError(reason);
1245
1412
  const cancelled = failure.code === "ABORTED";
1246
- if (!cancelled) fail(failure);
1413
+ if (!cancelled && !destroyed && started === generation) fail(failure);
1247
1414
  emit({
1248
1415
  type: "export",
1249
1416
  outcome: cancelled ? "cancelled" : "failed",
@@ -1271,6 +1438,7 @@ function createImageSession(options) {
1271
1438
  var imageMessages = /* @__PURE__ */ defineMessages({
1272
1439
  ...sdkCoreMessages,
1273
1440
  ...uiMessages,
1441
+ "editor.engineUnavailable": "Image processing stopped. Reload this page or reopen the editor, then choose the image again. Unsaved edits will be lost unless your application has saved them.",
1274
1442
  "errors.INVALID_IMAGE": "This file isn't a valid image, or it's too damaged to open.",
1275
1443
  "errors.UNSUPPORTED_FORMAT": "This image format isn't supported. Try converting the file to PNG or JPEG, then open it again.",
1276
1444
  "errors.DECODE_FAILED": "This browser can't open this kind of image. Try another browser, or convert the file to PNG or JPEG.",
@@ -1439,6 +1607,6 @@ var imageMessages = /* @__PURE__ */ defineMessages({
1439
1607
  "export.download": "Download",
1440
1608
  "export.close": "Done"
1441
1609
  });
1442
- export { imageLimits as $, onlyFields as A, createPlan as B, checkFilter as C, createImageReducer as D, checkOutput as E, DEVELOP_ADJUSTMENTS as F, placement as G, MAX_PIXEL_RATIO as H, FILTER_PRESETS as I, OUTPUT_LIMITS as J, createImageProcessor as K, FULL_SIZE as L, MAX_METADATA_LENGTH as M, NO_METADATA as N, invalid as O, longerThan as P, imageLimitDefinitions as Q, NEUTRAL_DEVELOP as R, checkDevelop as S, checkOrientation as T, backingSize as U, createImageRenderer as V, fittedView as W, checkFileLimits as X, PER_FILE_LIMITS as Y, checkOutputLimits as Z, outputSize as _, compositionDeltaToSource as a, checkCrop as b, fitAspect as c, nudgeCropOnScreen as d, ImageError as et, wholeCrop as f, orientedSize as g, cropRect as h, aspectRatio as i, EMPTY_KEEPABLE_METADATA as j, isRecord as k, handleInSource as l, compositionToSource as m, createImageSession as n, cropInComposition as o, compositionSize as p, createImageEngine as q, ASPECT_PRESETS as r, dragHandle as s, imageMessages as t, isImageError as tt, moveCrop as u, sourceToComposition as v, checkMetadata as w, checkCropInSource as x, Invalid as y, UPRIGHT as z };
1610
+ export { imageLimitDefinitions as $, onlyFields as A, createPlan as B, checkFilter as C, createImageReducer as D, checkOutput as E, DEVELOP_ADJUSTMENTS as F, placement as G, MAX_PIXEL_RATIO as H, FILTER_PRESETS as I, engineInternals as J, createImageProcessor as K, FULL_SIZE as L, MAX_METADATA_LENGTH as M, NO_METADATA as N, invalid as O, longerThan as P, checkOutputLimits as Q, NEUTRAL_DEVELOP as R, checkDevelop as S, checkOrientation as T, backingSize as U, createImageRenderer as V, fittedView as W, PER_FILE_LIMITS as X, OUTPUT_LIMITS as Y, checkFileLimits as Z, outputSize as _, compositionDeltaToSource as a, checkCrop as b, fitAspect as c, nudgeCropOnScreen as d, imageLimits as et, wholeCrop as f, orientedSize as g, cropRect as h, aspectRatio as i, EMPTY_KEEPABLE_METADATA as j, isRecord as k, handleInSource as l, compositionToSource as m, createImageSession as n, isImageError as nt, cropInComposition as o, compositionSize as p, createImageEngine as q, ASPECT_PRESETS as r, dragHandle as s, imageMessages as t, ImageError as tt, moveCrop as u, sourceToComposition as v, checkMetadata as w, checkCropInSource as x, Invalid as y, UPRIGHT as z };
1443
1611
 
1444
- //# sourceMappingURL=core-CAX3GOaj.js.map
1612
+ //# sourceMappingURL=core-BWNmXDlB.js.map