From fad3867adbfb3a38bec8a1a122d32f953a2072fb Mon Sep 17 00:00:00 2001
From: Tony Sullivan
Date: Thu, 22 Sep 2022 19:48:14 +0000
Subject: [PATCH] Adding an optional image service based on Squoosh (#4738)
* WIP: adding a service built on @squoosh/lib
* WIP: investigating memory leaks in Squoosh
* WIP: vendoring Squoosh to work with our build
* chore: a bit of cleanup and a small perf gain
* removing a few unused deps
* fix: removing temp .only() in sharp test
* hooking up the last build steps to copy over .wasm files
* removing the duplicated lib/*.wasm files
* defaulting to Sharp for the initial @next release
* make sure pnpm always runs the postbuild script
* removing a few node dependencies
* refactor: move the copy .wasm build step out of the SSR bundle
* linter fixes
* fixing lock file
* chore: add TEMP changeset
* fix built wasm location for SSG builds
* Revert "defaulting to Sharp for the initial @next release"
This reverts commit 1a8d4f7f603ac08b24ae6cd390f3a0fe39f4c87d.
* removing sharp dependency
* Revert "fix built wasm location for SSG builds"
This reverts commit 446b80bb53dee364bbf6dca30f26af7061a93d12.
* chore: update lockfile
* fixing up image tests for the wasm loader
* updating the README for squoosh
* parallel wasm builds
* refactor: a bit of house keeping
* perf: allow a thread for each output encoding format
* fix: dev broke with the shift to wasm workers
* adds a new `astro:build:generated` hook for SSG builds
* fix: typo + calling cleanup methods in wasm codecs
* adding @astrojs/webapi for the TransformStream polyfill
* Revert "adding @astrojs/webapi for the TransformStream polyfill"
This reverts commit 39e5b845a52ed489ea6e2a618a179694de06b3b5.
* perf: using sharp for most of the CI tests
* chore: update lockfile
* removing hard-coded squoosh imports
* fix: adding sharp to rollup externals
* test: using dev for the squoosh tests
* fix: updating the build output dir for wasm filles in SSG builds
* updating the changeset with migration details
* Revert "adds a new `astro:build:generated` hook for SSG builds"
This reverts commit 59b5fec7be203e53f5c4fcb43f2d3d81f4377282.
* nit: adding comments for the wasm file copy
* chore: fix eslint warning
---
.changeset/old-ladybugs-roll.md | 24 +
packages/integrations/image/README.md | 45 +-
packages/integrations/image/package.json | 13 +-
packages/integrations/image/src/build/ssg.ts | 28 +-
packages/integrations/image/src/endpoint.ts | 1 +
packages/integrations/image/src/index.ts | 84 +-
.../integrations/image/src/lib/get-image.ts | 5 +-
.../integrations/image/src/lib/get-picture.ts | 2 +-
.../integrations/image/src/loaders/index.ts | 113 +-
.../integrations/image/src/loaders/sharp.ts | 109 +-
.../integrations/image/src/loaders/squoosh.ts | 122 +
.../src/{loaders => utils}/colornames.ts | 0
.../integrations/image/src/utils/execOnce.ts | 14 +
.../integrations/image/src/utils/images.ts | 23 -
.../integrations/image/src/utils/metadata.ts | 9 +-
.../integrations/image/src/utils/paths.ts | 7 +-
.../image/src/utils/workerPool.ts | 125 +
.../image/src/vendor/squoosh/LICENSE | 245 ++
.../src/vendor/squoosh/avif/avif_enc.d.ts | 32 +
.../src/vendor/squoosh/avif/avif_node_dec.ts | 1799 ++++++++++++++
.../vendor/squoosh/avif/avif_node_dec.wasm | Bin 0 -> 1364059 bytes
.../src/vendor/squoosh/avif/avif_node_enc.ts | 2066 +++++++++++++++++
.../vendor/squoosh/avif/avif_node_enc.wasm | Bin 0 -> 2642196 bytes
.../image/src/vendor/squoosh/codecs.ts | 373 +++
.../image/src/vendor/squoosh/copy-wasm.ts | 24 +
.../src/vendor/squoosh/emscripten-types.d.ts | 121 +
.../src/vendor/squoosh/emscripten-utils.ts | 31 +
.../image/src/vendor/squoosh/image-pool.ts | 139 ++
.../image/src/vendor/squoosh/image.ts | 43 +
.../image/src/vendor/squoosh/image_data.ts | 33 +
.../image/src/vendor/squoosh/impl.ts | 135 ++
.../vendor/squoosh/mozjpeg/mozjpeg_enc.d.ts | 38 +
.../squoosh/mozjpeg/mozjpeg_node_dec.ts | 1809 +++++++++++++++
.../squoosh/mozjpeg/mozjpeg_node_dec.wasm | Bin 0 -> 163966 bytes
.../squoosh/mozjpeg/mozjpeg_node_enc.ts | 1935 +++++++++++++++
.../squoosh/mozjpeg/mozjpeg_node_enc.wasm | Bin 0 -> 251948 bytes
.../src/vendor/squoosh/png/squoosh_oxipng.ts | 120 +
.../vendor/squoosh/png/squoosh_oxipng_bg.wasm | Bin 0 -> 269158 bytes
.../src/vendor/squoosh/png/squoosh_png.ts | 184 ++
.../vendor/squoosh/png/squoosh_png_bg.wasm | Bin 0 -> 123698 bytes
.../vendor/squoosh/resize/squoosh_resize.ts | 141 ++
.../squoosh/resize/squoosh_resize_bg.wasm | Bin 0 -> 37052 bytes
.../src/vendor/squoosh/rotate/rotate.wasm | Bin 0 -> 1363 bytes
.../src/vendor/squoosh/webp/webp_enc.d.ts | 42 +
.../src/vendor/squoosh/webp/webp_node_dec.ts | 1648 +++++++++++++
.../vendor/squoosh/webp/webp_node_dec.wasm | Bin 0 -> 148687 bytes
.../src/vendor/squoosh/webp/webp_node_enc.ts | 1833 +++++++++++++++
.../vendor/squoosh/webp/webp_node_enc.wasm | Bin 0 -> 298327 bytes
.../image/src/vite-plugin-astro-image.ts | 5 +-
.../background-color-image/astro.config.mjs | 2 +-
.../background-color-image/package.json | 3 +-
.../fixtures/basic-image/astro.config.mjs | 2 +-
.../test/fixtures/basic-image/package.json | 3 +-
.../basic-image/src/pages/index.astro | 2 +-
.../fixtures/basic-picture/astro.config.mjs | 2 +-
.../test/fixtures/basic-picture/package.json | 3 +-
.../basic-picture/src/pages/index.astro | 2 +-
.../no-alt-text-image/astro.config.mjs | 2 +-
.../fixtures/no-alt-text-image/package.json | 3 +-
.../no-alt-text-picture/astro.config.mjs | 2 +-
.../fixtures/no-alt-text-picture/package.json | 3 +-
.../test/fixtures/rotation/astro.config.mjs | 2 +-
.../image/test/fixtures/rotation/package.json | 3 +-
.../fixtures/squoosh-service/astro.config.mjs | 8 +
.../fixtures/squoosh-service/package.json | 10 +
.../squoosh-service/public/favicon.ico | Bin 0 -> 4286 bytes
.../fixtures/squoosh-service/public/hero.jpg | Bin 0 -> 276382 bytes
.../squoosh-service/server/server.mjs | 44 +
.../src/assets/blog/introducing astro.jpg | Bin 0 -> 276382 bytes
.../squoosh-service/src/assets/social.jpg | Bin 0 -> 25266 bytes
.../squoosh-service/src/assets/social.png | Bin 0 -> 1512228 bytes
.../squoosh-service/src/pages/index.astro | 18 +
.../test/fixtures/with-mdx/astro.config.mjs | 2 +-
.../image/test/fixtures/with-mdx/package.json | 3 +-
.../integrations/image/test/image-ssg.test.js | 8 +-
.../image/test/image-ssr-build.test.js | 4 +-
.../image/test/image-ssr-dev.test.js | 4 +-
.../image/test/picture-ssg.test.js | 4 +-
.../image/test/picture-ssr-build.test.js | 4 +-
.../image/test/picture-ssr-dev.test.js | 4 +-
.../image/test/squoosh-service.test.js | 61 +
pnpm-lock.yaml | 679 +++---
82 files changed, 13865 insertions(+), 542 deletions(-)
create mode 100644 .changeset/old-ladybugs-roll.md
create mode 100644 packages/integrations/image/src/loaders/squoosh.ts
rename packages/integrations/image/src/{loaders => utils}/colornames.ts (100%)
create mode 100644 packages/integrations/image/src/utils/execOnce.ts
delete mode 100644 packages/integrations/image/src/utils/images.ts
create mode 100644 packages/integrations/image/src/utils/workerPool.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/LICENSE
create mode 100644 packages/integrations/image/src/vendor/squoosh/avif/avif_enc.d.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/avif/avif_node_enc.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/avif/avif_node_enc.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/codecs.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/copy-wasm.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/emscripten-types.d.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/emscripten-utils.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/image-pool.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/image.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/image_data.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/impl.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/mozjpeg/mozjpeg_enc.d.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/mozjpeg/mozjpeg_node_dec.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/mozjpeg/mozjpeg_node_dec.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/mozjpeg/mozjpeg_node_enc.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/mozjpeg/mozjpeg_node_enc.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/png/squoosh_oxipng.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/png/squoosh_oxipng_bg.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/png/squoosh_png.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/png/squoosh_png_bg.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/resize/squoosh_resize.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/resize/squoosh_resize_bg.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/rotate/rotate.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/webp/webp_enc.d.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/webp/webp_node_dec.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/webp/webp_node_dec.wasm
create mode 100644 packages/integrations/image/src/vendor/squoosh/webp/webp_node_enc.ts
create mode 100644 packages/integrations/image/src/vendor/squoosh/webp/webp_node_enc.wasm
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/package.json
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/public/favicon.ico
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/public/hero.jpg
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/server/server.mjs
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/src/assets/blog/introducing astro.jpg
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/src/assets/social.jpg
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/src/assets/social.png
create mode 100644 packages/integrations/image/test/fixtures/squoosh-service/src/pages/index.astro
create mode 100644 packages/integrations/image/test/squoosh-service.test.js
diff --git a/.changeset/old-ladybugs-roll.md b/.changeset/old-ladybugs-roll.md
new file mode 100644
index 000000000..2f114c513
--- /dev/null
+++ b/.changeset/old-ladybugs-roll.md
@@ -0,0 +1,24 @@
+---
+'@astrojs/image': minor
+---
+
+Adds a new built-in image service based on web assembly libraries :drum: web container support!
+
+**Migration:** Happy with the previous image service based on [`sharp`](https://sharp.pixelplumbing.com/)? No problem! Install `sharp` in your project and update your Astro config to match.
+
+```sh
+npm install sharp
+```
+
+```astro title="astro.config.mjs"
+---
+import image from '@astrojs/image';
+
+export default {
+ // ...
+ integrations: [image({
+ serviceEntryPoint: '@astrojs/image/sharp'
+ })],
+}
+---
+```
diff --git a/packages/integrations/image/README.md b/packages/integrations/image/README.md
index 497479302..dc8fd77bc 100644
--- a/packages/integrations/image/README.md
+++ b/packages/integrations/image/README.md
@@ -18,7 +18,7 @@ This **[Astro integration][astro-integration]** makes it easy to optimize images
Images play a big role in overall site performance and usability. Serving properly sized images makes all the difference but is often tricky to automate.
-This integration provides `` and `
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
The background color is used to fill the remaining background when using `contain` for the `fit` property.
The background color is also used for replacing the alpha channel with `sharp`'s `flatten` method. In case the output format
@@ -215,6 +242,8 @@ color representation with 3 or 6 hexadecimal characters in the form `#123[abc]`,
**Default:** `'cover'`
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
How the image should be resized to fit both `height` and `width`.
#### position
@@ -225,6 +254,8 @@ How the image should be resized to fit both `height` and `width`.
**Default:** `'centre'`
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
Position of the crop when fit is `cover` or `contain`.
### ``
@@ -316,6 +347,8 @@ The output formats to be used in the optimized image. If not provided, `webp` an
**Default:** `undefined`
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
The background color to use for replacing the alpha channel with `sharp`'s `flatten` method. In case the output format
doesn't support transparency (i.e. `jpeg`), it's advisable to include a background color, otherwise black will be used
as default replacement for transparent pixels.
@@ -334,6 +367,8 @@ color representation with 3 or 6 hexadecimal characters in the form `#123[abc]`,
**Default:** `'cover'`
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
How the image should be resized to fit both `height` and `width`.
#### position
@@ -346,6 +381,8 @@ How the image should be resized to fit both `height` and `width`.
**Default:** `'centre'`
+> This is not supported by the default Squoosh service. See the [installation section](#installing-sharp-optional) for details on using the `sharp` service instead.
+
Position of the crop when fit is `cover` or `contain`.
### `getImage`
@@ -380,12 +417,12 @@ This helper takes in an object with the same properties as the `` com
The integration can be configured to run with a different image service, either a hosted image service or a full image transformer that runs locally in your build or SSR deployment.
-> During development, local images may not have been published yet and would not be available to hosted image services. Local images will always use the built-in `sharp` service when using `astro dev`.
+> During development, local images may not have been published yet and would not be available to hosted image services. Local images will always use the built-in image service when using `astro dev`.
### config.serviceEntryPoint
-The `serviceEntryPoint` should resolve to the image service installed from NPM. The default entry point is `@astrojs/image/sharp`, which resolves to the entry point exported from this integration's `package.json`.
+The `serviceEntryPoint` should resolve to the image service installed from NPM. The default entry point is `@astrojs/image/squoosh`, which resolves to the entry point exported from this integration's `package.json`.
```js
// astro.config.mjs
diff --git a/packages/integrations/image/package.json b/packages/integrations/image/package.json
index a41e4732c..f1e36f0d3 100644
--- a/packages/integrations/image/package.json
+++ b/packages/integrations/image/package.json
@@ -23,6 +23,7 @@
".": "./dist/index.js",
"./endpoint": "./dist/endpoint.js",
"./sharp": "./dist/loaders/sharp.js",
+ "./squoosh": "./dist/loaders/squoosh.js",
"./components": "./components/index.js",
"./package.json": "./package.json",
"./client": "./client.d.ts",
@@ -34,8 +35,9 @@
"client.d.ts"
],
"scripts": {
- "build": "astro-scripts build \"src/**/*.ts\" && tsc",
- "build:ci": "astro-scripts build \"src/**/*.ts\"",
+ "build": "astro-scripts build \"src/**/*.ts\" && tsc && pnpm run postbuild",
+ "build:ci": "astro-scripts build \"src/**/*.ts\" && pnpm run postbuild",
+ "postbuild": "astro-scripts copy \"src/**/*.wasm\"",
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test": "mocha --exit --timeout 20000 test"
},
@@ -43,13 +45,14 @@
"@altano/tiny-async-pool": "^1.0.2",
"image-size": "^1.0.2",
"magic-string": "^0.25.9",
- "mime": "^3.0.0",
- "sharp": "^0.30.6"
+ "mime": "^3.0.0"
},
"devDependencies": {
"@types/sharp": "^0.30.5",
"astro": "workspace:*",
"astro-scripts": "workspace:*",
- "kleur": "^4.1.4"
+ "kleur": "^4.1.4",
+ "rollup-plugin-copy": "^3.4.0",
+ "web-streams-polyfill": "^3.2.1"
}
}
diff --git a/packages/integrations/image/src/build/ssg.ts b/packages/integrations/image/src/build/ssg.ts
index 9219b9afd..c3cc75642 100644
--- a/packages/integrations/image/src/build/ssg.ts
+++ b/packages/integrations/image/src/build/ssg.ts
@@ -6,10 +6,31 @@ import OS from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { SSRImageService, TransformOptions } from '../loaders/index.js';
-import { loadLocalImage, loadRemoteImage } from '../utils/images.js';
import { debug, info, LoggerLevel, warn } from '../utils/logger.js';
import { isRemoteImage } from '../utils/paths.js';
+async function loadLocalImage(src: string | URL) {
+ try {
+ return await fs.readFile(src);
+ } catch {
+ return undefined;
+ }
+}
+
+async function loadRemoteImage(src: string) {
+ try {
+ const res = await fetch(src);
+
+ if (!res.ok) {
+ return undefined;
+ }
+
+ return Buffer.from(await res.arrayBuffer());
+ } catch {
+ return undefined;
+ }
+}
+
function getTimeStat(timeStart: number, timeEnd: number) {
const buildTime = timeEnd - timeStart;
return buildTime < 750 ? `${Math.round(buildTime)}ms` : `${(buildTime / 1000).toFixed(2)}s`;
@@ -39,8 +60,6 @@ export async function ssgBuild({ loader, staticImages, config, outDir, logLevel
)}`,
});
- const inputFiles = new Set();
-
async function processStaticImage([src, transformsMap]: [
string,
Map
@@ -61,9 +80,6 @@ export async function ssgBuild({ loader, staticImages, config, outDir, logLevel
const inputFileURL = new URL(`.${src}`, outDir);
inputFile = fileURLToPath(inputFileURL);
inputBuffer = await loadLocalImage(inputFile);
-
- // track the local file used so the original can be copied over
- inputFiles.add(inputFile);
}
if (!inputBuffer) {
diff --git a/packages/integrations/image/src/endpoint.ts b/packages/integrations/image/src/endpoint.ts
index bb634cf0c..872403226 100644
--- a/packages/integrations/image/src/endpoint.ts
+++ b/packages/integrations/image/src/endpoint.ts
@@ -48,6 +48,7 @@ export const get: APIRoute = async ({ request }) => {
},
});
} catch (err: unknown) {
+ console.error(err);
return new Response(`Server Error: ${err}`, { status: 500 });
}
};
diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts
index 38c654354..f41b943d2 100644
--- a/packages/integrations/image/src/index.ts
+++ b/packages/integrations/image/src/index.ts
@@ -1,9 +1,10 @@
-import type { AstroConfig, AstroIntegration } from 'astro';
+import type { AstroConfig, AstroIntegration, BuildConfig } from 'astro';
import { ssgBuild } from './build/ssg.js';
-import type { ImageService, TransformOptions } from './loaders/index.js';
+import type { ImageService, SSRImageService, TransformOptions } from './loaders/index.js';
import type { LoggerLevel } from './utils/logger.js';
import { joinPaths, prependForwardSlash, propsToFilename } from './utils/paths.js';
import { createPlugin } from './vite-plugin-astro-image.js';
+import { copyWasmFiles } from './vendor/squoosh/copy-wasm.js';
export { getImage } from './lib/get-image.js';
export { getPicture } from './lib/get-picture.js';
@@ -13,12 +14,13 @@ const ROUTE_PATTERN = '/_image';
interface ImageIntegration {
loader?: ImageService;
+ defaultLoader: SSRImageService;
addStaticImage?: (transform: TransformOptions) => string;
}
declare global {
// eslint-disable-next-line no-var
- var astroImage: ImageIntegration | undefined;
+ var astroImage: ImageIntegration;
}
export interface IntegrationOptions {
@@ -31,12 +33,13 @@ export interface IntegrationOptions {
export default function integration(options: IntegrationOptions = {}): AstroIntegration {
const resolvedOptions = {
- serviceEntryPoint: '@astrojs/image/sharp',
+ serviceEntryPoint: '@astrojs/image/squoosh',
logLevel: 'info' as LoggerLevel,
...options,
};
let _config: AstroConfig;
+ let _buildConfig: BuildConfig;
// During SSG builds, this is used to track all transformed images required.
const staticImages = new Map>();
@@ -45,18 +48,26 @@ export default function integration(options: IntegrationOptions = {}): AstroInte
return {
plugins: [createPlugin(_config, resolvedOptions)],
optimizeDeps: {
- include: ['image-size', 'sharp'],
+ include: [
+ 'image-size',
+ ].filter(Boolean),
},
+ build: {
+ rollupOptions: {
+ external: ["sharp"]
+ }
+ },
ssr: {
noExternal: ['@astrojs/image', resolvedOptions.serviceEntryPoint],
},
+ assetsInclude: ['**/*.wasm']
};
}
return {
name: PKG_NAME,
hooks: {
- 'astro:config:setup': ({ command, config, updateConfig, injectRoute }) => {
+ 'astro:config:setup': async ({ command, config, updateConfig, injectRoute }) => {
_config = config;
updateConfig({ vite: getViteConfiguration() });
@@ -67,8 +78,20 @@ export default function integration(options: IntegrationOptions = {}): AstroInte
entryPoint: '@astrojs/image/endpoint',
});
}
+
+ const { default: defaultLoader } = await import(resolvedOptions.serviceEntryPoint === '@astrojs/image/sharp'
+ ? './loaders/sharp.js'
+ : './loaders/squoosh.js'
+ );
+
+ globalThis.astroImage = {
+ defaultLoader
+ }
},
- 'astro:build:setup': () => {
+ 'astro:build:start': async ({ buildConfig }) => {
+ _buildConfig = buildConfig
+ },
+ 'astro:build:setup': async () => {
// Used to cache all images rendered to HTML
// Added to globalThis to share the same map in Node and Vite
function addStaticImage(transform: TransformOptions) {
@@ -89,29 +112,36 @@ export default function integration(options: IntegrationOptions = {}): AstroInte
}
// Helpers for building static images should only be available for SSG
- globalThis.astroImage =
- _config.output === 'static'
- ? {
- addStaticImage,
- }
- : {};
- },
- 'astro:build:done': async ({ dir }) => {
if (_config.output === 'static') {
- // for SSG builds, build all requested image transforms to dist
- const loader = globalThis?.astroImage?.loader;
-
- if (loader && 'transform' in loader && staticImages.size > 0) {
- await ssgBuild({
- loader,
- staticImages,
- config: _config,
- outDir: dir,
- logLevel: resolvedOptions.logLevel,
- });
- }
+ globalThis.astroImage.addStaticImage = addStaticImage;
}
},
+ 'astro:build:generated': async ({ dir }) => {
+ // for SSG builds, build all requested image transforms to dist
+ const loader = globalThis?.astroImage?.loader;
+
+ if (resolvedOptions.serviceEntryPoint === '@astrojs/image/squoosh') {
+ // For the Squoosh service, copy all wasm files to dist/chunks.
+ // Because the default loader is dynamically imported (above),
+ // Vite will bundle squoosh to dist/chunks and expect to find the wasm files there
+ await copyWasmFiles(new URL('./chunks', dir));
+ }
+
+ if (loader && 'transform' in loader && staticImages.size > 0) {
+ await ssgBuild({
+ loader,
+ staticImages,
+ config: _config,
+ outDir: dir,
+ logLevel: resolvedOptions.logLevel,
+ });
+ }
+ },
+ 'astro:build:ssr': async () => {
+ if (resolvedOptions.serviceEntryPoint === '@astrojs/image/squoosh') {
+ await copyWasmFiles(_buildConfig.server);
+ }
+ }
},
};
}
diff --git a/packages/integrations/image/src/lib/get-image.ts b/packages/integrations/image/src/lib/get-image.ts
index 856f9f8c6..5e7f4d0a4 100644
--- a/packages/integrations/image/src/lib/get-image.ts
+++ b/packages/integrations/image/src/lib/get-image.ts
@@ -6,7 +6,6 @@ import type {
TransformOptions,
} from '../loaders/index.js';
import { isSSRService, parseAspectRatio } from '../loaders/index.js';
-import sharp from '../loaders/sharp.js';
import { isRemoteImage } from '../utils/paths.js';
import type { ImageMetadata } from '../vite-plugin-astro-image.js';
@@ -131,7 +130,7 @@ export async function getImage(
const isDev = import.meta.env?.DEV;
const isLocalImage = !isRemoteImage(resolved.src);
- const _loader = isDev && isLocalImage ? sharp : loader;
+ const _loader = isDev && isLocalImage ? globalThis.astroImage.defaultLoader : loader;
if (!_loader) {
throw new Error('@astrojs/image: loader not found!');
@@ -139,7 +138,7 @@ export async function getImage(
const { searchParams } = isSSRService(_loader)
? _loader.serializeTransform(resolved)
- : sharp.serializeTransform(resolved);
+ : globalThis.astroImage.defaultLoader.serializeTransform(resolved);
let src: string;
diff --git a/packages/integrations/image/src/lib/get-picture.ts b/packages/integrations/image/src/lib/get-picture.ts
index 132d93ee1..e3b07b505 100644
--- a/packages/integrations/image/src/lib/get-picture.ts
+++ b/packages/integrations/image/src/lib/get-picture.ts
@@ -1,9 +1,9 @@
///
import mime from 'mime';
-import { extname } from 'node:path';
import { OutputFormat, parseAspectRatio, TransformOptions } from '../loaders/index.js';
import { ImageMetadata } from '../vite-plugin-astro-image.js';
import { getImage } from './get-image.js';
+import { extname } from '../utils/paths.js';
export interface GetPictureParams {
src: string | ImageMetadata | Promise<{ default: ImageMetadata }>;
diff --git a/packages/integrations/image/src/loaders/index.ts b/packages/integrations/image/src/loaders/index.ts
index 2f3279a5a..30ccb879f 100644
--- a/packages/integrations/image/src/loaders/index.ts
+++ b/packages/integrations/image/src/loaders/index.ts
@@ -1,4 +1,5 @@
-import { htmlColorNames, type NamedColor } from './colornames.js';
+import { AstroConfig } from 'astro';
+import { htmlColorNames, type NamedColor } from '../utils/colornames.js';
///
export type InputFormat =
@@ -13,7 +14,7 @@ export type InputFormat =
| 'gif';
export type OutputFormatSupportsAlpha = 'avif' | 'png' | 'webp';
-export type OutputFormat = OutputFormatSupportsAlpha | 'jpeg';
+export type OutputFormat = OutputFormatSupportsAlpha | 'jpeg' | 'jpg';
export type ColorDefinition =
| NamedColor
@@ -49,7 +50,7 @@ export type CropPosition =
| 'attention';
export function isOutputFormat(value: string): value is OutputFormat {
- return ['avif', 'jpeg', 'png', 'webp'].includes(value);
+ return ['avif', 'jpeg', 'jpg', 'png', 'webp'].includes(value);
}
export function isOutputFormatSupportsAlpha(value: string): value is OutputFormatSupportsAlpha {
@@ -194,3 +195,109 @@ export function isHostedService(service: ImageService): service is ImageService
export function isSSRService(service: ImageService): service is SSRImageService {
return 'transform' in service;
}
+
+export abstract class BaseSSRService implements SSRImageService {
+ async getImageAttributes(transform: TransformOptions) {
+ // strip off the known attributes
+ const { width, height, src, format, quality, aspectRatio, ...rest } = transform;
+
+ return {
+ ...rest,
+ width: width,
+ height: height,
+ };
+ }
+
+ serializeTransform(transform: TransformOptions) {
+ const searchParams = new URLSearchParams();
+
+ if (transform.quality) {
+ searchParams.append('q', transform.quality.toString());
+ }
+
+ if (transform.format) {
+ searchParams.append('f', transform.format);
+ }
+
+ if (transform.width) {
+ searchParams.append('w', transform.width.toString());
+ }
+
+ if (transform.height) {
+ searchParams.append('h', transform.height.toString());
+ }
+
+ if (transform.aspectRatio) {
+ searchParams.append('ar', transform.aspectRatio.toString());
+ }
+
+ if (transform.fit) {
+ searchParams.append('fit', transform.fit);
+ }
+
+ if (transform.background) {
+ searchParams.append('bg', transform.background);
+ }
+
+ if (transform.position) {
+ searchParams.append('p', encodeURI(transform.position));
+ }
+
+ searchParams.append('href', transform.src);
+
+ return { searchParams };
+ }
+
+ parseTransform(searchParams: URLSearchParams) {
+ if (!searchParams.has('href')) {
+ return undefined;
+ }
+
+ let transform: TransformOptions = { src: searchParams.get('href')! };
+
+ if (searchParams.has('q')) {
+ transform.quality = parseInt(searchParams.get('q')!);
+ }
+
+ if (searchParams.has('f')) {
+ const format = searchParams.get('f')!;
+ if (isOutputFormat(format)) {
+ transform.format = format;
+ }
+ }
+
+ if (searchParams.has('w')) {
+ transform.width = parseInt(searchParams.get('w')!);
+ }
+
+ if (searchParams.has('h')) {
+ transform.height = parseInt(searchParams.get('h')!);
+ }
+
+ if (searchParams.has('ar')) {
+ const ratio = searchParams.get('ar')!;
+
+ if (isAspectRatioString(ratio)) {
+ transform.aspectRatio = ratio;
+ } else {
+ transform.aspectRatio = parseFloat(ratio);
+ }
+ }
+
+ if (searchParams.has('fit')) {
+ transform.fit = searchParams.get('fit') as typeof transform.fit;
+ }
+
+ if (searchParams.has('p')) {
+ transform.position = decodeURI(searchParams.get('p')!) as typeof transform.position;
+ }
+
+ if (searchParams.has('bg')) {
+ transform.background = searchParams.get('bg') as ColorDefinition;
+ }
+
+ return transform;
+ }
+
+ abstract transform(inputBuffer: Buffer, transform: TransformOptions): Promise<{ data: Buffer, format: OutputFormat }>;
+}
diff --git a/packages/integrations/image/src/loaders/sharp.ts b/packages/integrations/image/src/loaders/sharp.ts
index e7ef57aa0..dd58aacb0 100644
--- a/packages/integrations/image/src/loaders/sharp.ts
+++ b/packages/integrations/image/src/loaders/sharp.ts
@@ -1,110 +1,9 @@
import sharp from 'sharp';
-import {
- ColorDefinition,
- isAspectRatioString,
- isOutputFormat,
- isOutputFormatSupportsAlpha,
-} from '../loaders/index.js';
-import type { OutputFormat, SSRImageService, TransformOptions } from './index.js';
-
-class SharpService implements SSRImageService {
- async getImageAttributes(transform: TransformOptions) {
- // strip off the known attributes
- const { width, height, src, format, quality, aspectRatio, fit, position, background, ...rest } =
- transform;
-
- return {
- ...rest,
- width: width,
- height: height,
- };
- }
-
- serializeTransform(transform: TransformOptions) {
- const searchParams = new URLSearchParams();
-
- if (transform.quality) {
- searchParams.append('q', transform.quality.toString());
- }
-
- if (transform.format) {
- searchParams.append('f', transform.format);
- }
-
- if (transform.width) {
- searchParams.append('w', transform.width.toString());
- }
-
- if (transform.height) {
- searchParams.append('h', transform.height.toString());
- }
-
- if (transform.aspectRatio) {
- searchParams.append('ar', transform.aspectRatio.toString());
- }
-
- if (transform.fit) {
- searchParams.append('fit', transform.fit);
- }
-
- if (transform.background) {
- searchParams.append('bg', transform.background);
- }
-
- if (transform.position) {
- searchParams.append('p', encodeURI(transform.position));
- }
-
- return { searchParams };
- }
-
- parseTransform(searchParams: URLSearchParams) {
- let transform: TransformOptions = { src: searchParams.get('href')! };
-
- if (searchParams.has('q')) {
- transform.quality = parseInt(searchParams.get('q')!);
- }
-
- if (searchParams.has('f')) {
- const format = searchParams.get('f')!;
- if (isOutputFormat(format)) {
- transform.format = format;
- }
- }
-
- if (searchParams.has('w')) {
- transform.width = parseInt(searchParams.get('w')!);
- }
-
- if (searchParams.has('h')) {
- transform.height = parseInt(searchParams.get('h')!);
- }
-
- if (searchParams.has('ar')) {
- const ratio = searchParams.get('ar')!;
-
- if (isAspectRatioString(ratio)) {
- transform.aspectRatio = ratio;
- } else {
- transform.aspectRatio = parseFloat(ratio);
- }
- }
-
- if (searchParams.has('fit')) {
- transform.fit = searchParams.get('fit') as typeof transform.fit;
- }
-
- if (searchParams.has('p')) {
- transform.position = decodeURI(searchParams.get('p')!) as typeof transform.position;
- }
-
- if (searchParams.has('bg')) {
- transform.background = searchParams.get('bg') as ColorDefinition | undefined;
- }
-
- return transform;
- }
+import { BaseSSRService, isOutputFormatSupportsAlpha } from '../loaders/index.js';
+import type { SSRImageService } from '../loaders/index.js';
+import type { OutputFormat, TransformOptions } from './index.js';
+class SharpService extends BaseSSRService {
async transform(inputBuffer: Buffer, transform: TransformOptions) {
const sharpImage = sharp(inputBuffer, { failOnError: false, pages: -1 });
diff --git a/packages/integrations/image/src/loaders/squoosh.ts b/packages/integrations/image/src/loaders/squoosh.ts
new file mode 100644
index 000000000..b4e9d636a
--- /dev/null
+++ b/packages/integrations/image/src/loaders/squoosh.ts
@@ -0,0 +1,122 @@
+// @ts-ignore
+import { red } from 'kleur/colors';
+import { BaseSSRService } from './index.js';
+import { error } from '../utils/logger.js';
+import { metadata } from '../utils/metadata.js';
+import { isRemoteImage } from '../utils/paths.js';
+import type { OutputFormat, TransformOptions } from './index.js';
+import { processBuffer } from '../vendor/squoosh/image-pool.js';
+import type { Operation } from '../vendor/squoosh/image.js';
+
+class SquooshService extends BaseSSRService {
+ async processAvif(image: any, transform: TransformOptions) {
+ const encodeOptions = transform.quality
+ ? { avif: { quality: transform.quality } }
+ : { avif: {} };
+ await image.encode(encodeOptions);
+ const data = await image.encodedWith.avif;
+
+ return {
+ data: data.binary,
+ format: 'avif' as OutputFormat,
+ };
+ }
+
+ async processJpeg(image: any, transform: TransformOptions) {
+ const encodeOptions = transform.quality
+ ? { mozjpeg: { quality: transform.quality } }
+ : { mozjpeg: {} };
+ await image.encode(encodeOptions);
+ const data = await image.encodedWith.mozjpeg;
+
+ return {
+ data: data.binary,
+ format: 'jpeg' as OutputFormat,
+ };
+ }
+
+ async processPng(image: any, transform: TransformOptions) {
+ await image.encode({ oxipng: {} });
+ const data = await image.encodedWith.oxipng;
+
+ return {
+ data: data.binary,
+ format: 'png' as OutputFormat,
+ };
+ }
+
+ async processWebp(image: any, transform: TransformOptions) {
+ const encodeOptions = transform.quality
+ ? { webp: { quality: transform.quality } }
+ : { webp: {} };
+ await image.encode(encodeOptions);
+ const data = await image.encodedWith.webp;
+
+ return {
+ data: data.binary,
+ format: 'webp' as OutputFormat,
+ };
+ }
+
+ async autorotate(transform: TransformOptions, inputBuffer: Buffer): Promise {
+ // check EXIF orientation data and rotate the image if needed
+ try {
+ const meta = await metadata(transform.src, inputBuffer);
+
+ switch (meta?.orientation) {
+ case 3:
+ case 4:
+ return { type: 'rotate', numRotations: 2 };
+ case 5:
+ case 6:
+ return { type: 'rotate', numRotations: 1 };
+ case 7:
+ case 8:
+ return { type: 'rotate', numRotations: 3 };
+ }
+ } catch { }
+ }
+
+ async transform(inputBuffer: Buffer, transform: TransformOptions) {
+ const operations: Operation[] = [];
+
+ if (!isRemoteImage(transform.src)) {
+ const autorotate = await this.autorotate(transform, inputBuffer)
+
+ if (autorotate) {
+ operations.push(autorotate);
+ }
+ }
+
+ if (transform.width || transform.height) {
+ const width = transform.width && Math.round(transform.width);
+ const height = transform.height && Math.round(transform.height);
+
+ operations.push({
+ type: 'resize',
+ width,
+ height,
+ })
+ }
+
+ if (!transform.format) {
+ error({
+ level: 'info',
+ prefix: false,
+ message: red(`Unknown image output: "${transform.format}" used for ${transform.src}`),
+ });
+ throw new Error(`Unknown image output: "${transform.format}" used for ${transform.src}`);
+ }
+
+ const data = await processBuffer(inputBuffer, operations, transform.format, transform.quality || 100);
+
+ return {
+ data: Buffer.from(data),
+ format: transform.format
+ }
+ }
+}
+
+const service = new SquooshService();
+
+export default service;
diff --git a/packages/integrations/image/src/loaders/colornames.ts b/packages/integrations/image/src/utils/colornames.ts
similarity index 100%
rename from packages/integrations/image/src/loaders/colornames.ts
rename to packages/integrations/image/src/utils/colornames.ts
diff --git a/packages/integrations/image/src/utils/execOnce.ts b/packages/integrations/image/src/utils/execOnce.ts
new file mode 100644
index 000000000..1a9a7ba68
--- /dev/null
+++ b/packages/integrations/image/src/utils/execOnce.ts
@@ -0,0 +1,14 @@
+export default function execOnce ReturnType>(
+ fn: T
+): T {
+ let used = false
+ let result: ReturnType
+
+ return ((...args: any[]) => {
+ if (!used) {
+ used = true
+ result = fn(...args)
+ }
+ return result
+ }) as T
+}
diff --git a/packages/integrations/image/src/utils/images.ts b/packages/integrations/image/src/utils/images.ts
deleted file mode 100644
index f9b94b1e8..000000000
--- a/packages/integrations/image/src/utils/images.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import fs from 'node:fs/promises';
-
-export async function loadLocalImage(src: string | URL) {
- try {
- return await fs.readFile(src);
- } catch {
- return undefined;
- }
-}
-
-export async function loadRemoteImage(src: string) {
- try {
- const res = await fetch(src);
-
- if (!res.ok) {
- return undefined;
- }
-
- return Buffer.from(await res.arrayBuffer());
- } catch {
- return undefined;
- }
-}
diff --git a/packages/integrations/image/src/utils/metadata.ts b/packages/integrations/image/src/utils/metadata.ts
index 1c3bebdf0..23e83b614 100644
--- a/packages/integrations/image/src/utils/metadata.ts
+++ b/packages/integrations/image/src/utils/metadata.ts
@@ -4,8 +4,12 @@ import { fileURLToPath } from 'node:url';
import { InputFormat } from '../loaders/index.js';
import { ImageMetadata } from '../vite-plugin-astro-image.js';
-export async function metadata(src: URL): Promise {
- const file = await fs.readFile(src);
+export interface Metadata extends ImageMetadata {
+ orientation?: number;
+}
+
+export async function metadata(src: URL | string, data?: Buffer): Promise {
+ const file = data || await fs.readFile(src);
const { width, height, type, orientation } = await sizeOf(file);
const isPortrait = (orientation || 0) >= 5;
@@ -19,5 +23,6 @@ export async function metadata(src: URL): Promise {
width: isPortrait ? height : width,
height: isPortrait ? width : height,
format: type as InputFormat,
+ orientation,
};
}
diff --git a/packages/integrations/image/src/utils/paths.ts b/packages/integrations/image/src/utils/paths.ts
index 1f691f35a..1ebf3ece7 100644
--- a/packages/integrations/image/src/utils/paths.ts
+++ b/packages/integrations/image/src/utils/paths.ts
@@ -10,14 +10,15 @@ function removeQueryString(src: string) {
return index > 0 ? src.substring(0, index) : src;
}
-function extname(src: string, format?: OutputFormat) {
- const index = src.lastIndexOf('.');
+export function extname(src: string) {
+ const base = basename(src);
+ const index = base.lastIndexOf('.');
if (index <= 0) {
return '';
}
- return src.substring(index);
+ return src.substring(src.length - (base.length - index));
}
function removeExtname(src: string) {
diff --git a/packages/integrations/image/src/utils/workerPool.ts b/packages/integrations/image/src/utils/workerPool.ts
new file mode 100644
index 000000000..5b6b75829
--- /dev/null
+++ b/packages/integrations/image/src/utils/workerPool.ts
@@ -0,0 +1,125 @@
+/* tslint-disable ban-types */
+import { Worker, parentPort } from 'worker_threads';
+import { TransformStream } from 'web-streams-polyfill';
+
+function uuid() {
+ return Array.from({ length: 16 }, () =>
+ Math.floor(Math.random() * 256).toString(16),
+ ).join('');
+}
+
+interface Job {
+ msg: I;
+ resolve: (result: any) => void;
+ reject: (reason: any) => void;
+}
+
+export default class WorkerPool {
+ public numWorkers: number;
+ public jobQueue: TransformStream, Job>;
+ public workerQueue: TransformStream;
+ public done: Promise;
+
+ constructor(numWorkers: number, workerFile: string) {
+ this.numWorkers = numWorkers;
+ this.jobQueue = new TransformStream();
+ this.workerQueue = new TransformStream();
+
+ const writer = this.workerQueue.writable.getWriter();
+ for (let i = 0; i < numWorkers; i++) {
+ writer.write(new Worker(workerFile));
+ }
+ writer.releaseLock();
+
+ this.done = this._readLoop();
+ }
+
+ async _readLoop() {
+ const reader = this.jobQueue.readable.getReader();
+ while (true) {
+ const { value, done } = await reader.read();
+ if (done) {
+ await this._terminateAll();
+ return;
+ }
+
+ if (!value) {
+ throw new Error('Reader did not return any value');
+ }
+
+ const { msg, resolve, reject } = value;
+ const worker = await this._nextWorker();
+ this.jobPromise(worker, msg)
+ .then((result) => resolve(result))
+ .catch((reason) => reject(reason))
+ .finally(() => {
+ // Return the worker to the pool
+ const writer = this.workerQueue.writable.getWriter();
+ writer.write(worker);
+ writer.releaseLock();
+ });
+ }
+ }
+
+ async _nextWorker() {
+ const reader = this.workerQueue.readable.getReader();
+ const { value } = await reader.read();
+ reader.releaseLock();
+ if (!value) {
+ throw new Error('No worker left');
+ }
+
+ return value;
+ }
+
+ async _terminateAll() {
+ for (let n = 0; n < this.numWorkers; n++) {
+ const worker = await this._nextWorker();
+ worker.terminate();
+ }
+ this.workerQueue.writable.close();
+ }
+
+ async join() {
+ this.jobQueue.writable.getWriter().close();
+ await this.done;
+ }
+
+ dispatchJob(msg: I): Promise {
+ return new Promise((resolve, reject) => {
+ const writer = this.jobQueue.writable.getWriter();
+ writer.write({ msg, resolve, reject });
+ writer.releaseLock();
+ });
+ }
+
+ private jobPromise(worker: Worker, msg: I) {
+ return new Promise((resolve, reject) => {
+ const id = uuid();
+ worker.postMessage({ msg, id });
+ worker.on('message', function f({ error, result, id: rid }) {
+ if (rid !== id) {
+ return;
+ }
+ if (error) {
+ reject(error);
+ return;
+ }
+ worker.off('message', f);
+ resolve(result);
+ });
+ });
+ }
+
+ static useThisThreadAsWorker(cb: (msg: I) => O) {
+ parentPort!.on('message', async (data) => {
+ const { msg, id } = data;
+ try {
+ const result = await cb(msg);
+ parentPort!.postMessage({ result, id });
+ } catch (e: any) {
+ parentPort!.postMessage({ error: e.message, id });
+ }
+ });
+ }
+}
diff --git a/packages/integrations/image/src/vendor/squoosh/LICENSE b/packages/integrations/image/src/vendor/squoosh/LICENSE
new file mode 100644
index 000000000..fe27d9324
--- /dev/null
+++ b/packages/integrations/image/src/vendor/squoosh/LICENSE
@@ -0,0 +1,245 @@
+
+Skip to content
+Pull requests
+Issues
+Marketplace
+Explore
+@tony-sull
+vercel /
+next.js
+Public
+
+Code
+Issues 1.1k
+Pull requests 216
+Discussions
+Actions
+Security 8
+
+ Insights
+
+next.js/packages/next/server/lib/squoosh/LICENSE
+@timneutkens
+timneutkens Move next-server directory files to server directory (#26756)
+Latest commit 5b9ad8d on Jun 30, 2021
+History
+1 contributor
+202 lines (169 sloc) 11.1 KB
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+Footer
+© 2022 GitHub, Inc.
+Footer navigation
+
+ Terms
+ Privacy
+ Security
+ Status
+ Docs
+ Contact GitHub
+ Pricing
+ API
+ Training
+ Blog
+ About
+
diff --git a/packages/integrations/image/src/vendor/squoosh/avif/avif_enc.d.ts b/packages/integrations/image/src/vendor/squoosh/avif/avif_enc.d.ts
new file mode 100644
index 000000000..d91bbf36e
--- /dev/null
+++ b/packages/integrations/image/src/vendor/squoosh/avif/avif_enc.d.ts
@@ -0,0 +1,32 @@
+// eslint-disable-next-line no-shadow
+export const enum AVIFTune {
+ auto,
+ psnr,
+ ssim,
+}
+
+export interface EncodeOptions {
+ cqLevel: number
+ denoiseLevel: number
+ cqAlphaLevel: number
+ tileRowsLog2: number
+ tileColsLog2: number
+ speed: number
+ subsample: number
+ chromaDeltaQ: boolean
+ sharpness: number
+ tune: AVIFTune
+}
+
+export interface AVIFModule extends EmscriptenWasm.Module {
+ encode(
+ data: BufferSource,
+ width: number,
+ height: number,
+ options: EncodeOptions
+ ): Uint8Array
+}
+
+declare var moduleFactory: EmscriptenWasm.ModuleFactory
+
+export default moduleFactory
diff --git a/packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.ts b/packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.ts
new file mode 100644
index 000000000..44f9ab33d
--- /dev/null
+++ b/packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.ts
@@ -0,0 +1,1799 @@
+/* eslint-disable */
+// @ts-nocheck
+import { createRequire } from 'module';
+const require = createRequire(import.meta.url);
+import { dirname } from '../emscripten-utils.js';
+
+var Module = (function () {
+ return function (Module) {
+ Module = Module || {}
+
+ var Module = typeof Module !== 'undefined' ? Module : {}
+ var readyPromiseResolve, readyPromiseReject
+ Module['ready'] = new Promise(function (resolve, reject) {
+ readyPromiseResolve = resolve
+ readyPromiseReject = reject
+ })
+ var moduleOverrides = {}
+ var key
+ for (key in Module) {
+ if (Module.hasOwnProperty(key)) {
+ moduleOverrides[key] = Module[key]
+ }
+ }
+ var arguments_ = []
+ var thisProgram = './this.program'
+ var quit_ = function (status, toThrow) {
+ throw toThrow
+ }
+ var ENVIRONMENT_IS_WEB = false
+ var ENVIRONMENT_IS_WORKER = false
+ var ENVIRONMENT_IS_NODE = true
+ var scriptDirectory = ''
+ function locateFile(path) {
+ if (Module['locateFile']) {
+ return Module['locateFile'](path, scriptDirectory)
+ }
+ return scriptDirectory + path
+ }
+ var read_, readBinary
+ var nodeFS
+ var nodePath
+ if (ENVIRONMENT_IS_NODE) {
+ if (ENVIRONMENT_IS_WORKER) {
+ scriptDirectory = require('path').dirname(scriptDirectory) + '/'
+ } else {
+ scriptDirectory = dirname(import.meta.url) + '/'
+ }
+ read_ = function shell_read(filename, binary) {
+ if (!nodeFS) nodeFS = require('fs')
+ if (!nodePath) nodePath = require('path')
+ filename = nodePath['normalize'](filename)
+ return nodeFS['readFileSync'](filename, binary ? null : 'utf8')
+ }
+ readBinary = function readBinary(filename) {
+ var ret = read_(filename, true)
+ if (!ret.buffer) {
+ ret = new Uint8Array(ret)
+ }
+ assert(ret.buffer)
+ return ret
+ }
+ if (process['argv'].length > 1) {
+ thisProgram = process['argv'][1].replace(/\\/g, '/')
+ }
+ arguments_ = process['argv'].slice(2)
+ quit_ = function (status) {
+ process['exit'](status)
+ }
+ Module['inspect'] = function () {
+ return '[Emscripten Module object]'
+ }
+ } else {
+ }
+ var out = Module['print'] || console.log.bind(console)
+ var err = Module['printErr'] || console.warn.bind(console)
+ for (key in moduleOverrides) {
+ if (moduleOverrides.hasOwnProperty(key)) {
+ Module[key] = moduleOverrides[key]
+ }
+ }
+ moduleOverrides = null
+ if (Module['arguments']) arguments_ = Module['arguments']
+ if (Module['thisProgram']) thisProgram = Module['thisProgram']
+ if (Module['quit']) quit_ = Module['quit']
+ var tempRet0 = 0
+ var setTempRet0 = function (value) {
+ tempRet0 = value
+ }
+ var getTempRet0 = function () {
+ return tempRet0
+ }
+ var wasmBinary
+ if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']
+ var noExitRuntime = Module['noExitRuntime'] || true
+ if (typeof WebAssembly !== 'object') {
+ abort('no native wasm support detected')
+ }
+ var wasmMemory
+ var ABORT = false
+ var EXITSTATUS
+ function assert(condition, text) {
+ if (!condition) {
+ abort('Assertion failed: ' + text)
+ }
+ }
+ var UTF8Decoder = new TextDecoder('utf8')
+ function UTF8ArrayToString(heap, idx, maxBytesToRead) {
+ var endIdx = idx + maxBytesToRead
+ var endPtr = idx
+ while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr
+ return UTF8Decoder.decode(
+ heap.subarray
+ ? heap.subarray(idx, endPtr)
+ : new Uint8Array(heap.slice(idx, endPtr))
+ )
+ }
+ function UTF8ToString(ptr, maxBytesToRead) {
+ if (!ptr) return ''
+ var maxPtr = ptr + maxBytesToRead
+ for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) ++end
+ return UTF8Decoder.decode(HEAPU8.subarray(ptr, end))
+ }
+ function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
+ if (!(maxBytesToWrite > 0)) return 0
+ var startIdx = outIdx
+ var endIdx = outIdx + maxBytesToWrite - 1
+ for (var i = 0; i < str.length; ++i) {
+ var u = str.charCodeAt(i)
+ if (u >= 55296 && u <= 57343) {
+ var u1 = str.charCodeAt(++i)
+ u = (65536 + ((u & 1023) << 10)) | (u1 & 1023)
+ }
+ if (u <= 127) {
+ if (outIdx >= endIdx) break
+ heap[outIdx++] = u
+ } else if (u <= 2047) {
+ if (outIdx + 1 >= endIdx) break
+ heap[outIdx++] = 192 | (u >> 6)
+ heap[outIdx++] = 128 | (u & 63)
+ } else if (u <= 65535) {
+ if (outIdx + 2 >= endIdx) break
+ heap[outIdx++] = 224 | (u >> 12)
+ heap[outIdx++] = 128 | ((u >> 6) & 63)
+ heap[outIdx++] = 128 | (u & 63)
+ } else {
+ if (outIdx + 3 >= endIdx) break
+ heap[outIdx++] = 240 | (u >> 18)
+ heap[outIdx++] = 128 | ((u >> 12) & 63)
+ heap[outIdx++] = 128 | ((u >> 6) & 63)
+ heap[outIdx++] = 128 | (u & 63)
+ }
+ }
+ heap[outIdx] = 0
+ return outIdx - startIdx
+ }
+ function stringToUTF8(str, outPtr, maxBytesToWrite) {
+ return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite)
+ }
+ function lengthBytesUTF8(str) {
+ var len = 0
+ for (var i = 0; i < str.length; ++i) {
+ var u = str.charCodeAt(i)
+ if (u >= 55296 && u <= 57343)
+ u = (65536 + ((u & 1023) << 10)) | (str.charCodeAt(++i) & 1023)
+ if (u <= 127) ++len
+ else if (u <= 2047) len += 2
+ else if (u <= 65535) len += 3
+ else len += 4
+ }
+ return len
+ }
+ var UTF16Decoder = new TextDecoder('utf-16le')
+ function UTF16ToString(ptr, maxBytesToRead) {
+ var endPtr = ptr
+ var idx = endPtr >> 1
+ var maxIdx = idx + maxBytesToRead / 2
+ while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx
+ endPtr = idx << 1
+ return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr))
+ var str = ''
+ for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {
+ var codeUnit = HEAP16[(ptr + i * 2) >> 1]
+ if (codeUnit == 0) break
+ str += String.fromCharCode(codeUnit)
+ }
+ return str
+ }
+ function stringToUTF16(str, outPtr, maxBytesToWrite) {
+ if (maxBytesToWrite === undefined) {
+ maxBytesToWrite = 2147483647
+ }
+ if (maxBytesToWrite < 2) return 0
+ maxBytesToWrite -= 2
+ var startPtr = outPtr
+ var numCharsToWrite =
+ maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length
+ for (var i = 0; i < numCharsToWrite; ++i) {
+ var codeUnit = str.charCodeAt(i)
+ HEAP16[outPtr >> 1] = codeUnit
+ outPtr += 2
+ }
+ HEAP16[outPtr >> 1] = 0
+ return outPtr - startPtr
+ }
+ function lengthBytesUTF16(str) {
+ return str.length * 2
+ }
+ function UTF32ToString(ptr, maxBytesToRead) {
+ var i = 0
+ var str = ''
+ while (!(i >= maxBytesToRead / 4)) {
+ var utf32 = HEAP32[(ptr + i * 4) >> 2]
+ if (utf32 == 0) break
+ ++i
+ if (utf32 >= 65536) {
+ var ch = utf32 - 65536
+ str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023))
+ } else {
+ str += String.fromCharCode(utf32)
+ }
+ }
+ return str
+ }
+ function stringToUTF32(str, outPtr, maxBytesToWrite) {
+ if (maxBytesToWrite === undefined) {
+ maxBytesToWrite = 2147483647
+ }
+ if (maxBytesToWrite < 4) return 0
+ var startPtr = outPtr
+ var endPtr = startPtr + maxBytesToWrite - 4
+ for (var i = 0; i < str.length; ++i) {
+ var codeUnit = str.charCodeAt(i)
+ if (codeUnit >= 55296 && codeUnit <= 57343) {
+ var trailSurrogate = str.charCodeAt(++i)
+ codeUnit =
+ (65536 + ((codeUnit & 1023) << 10)) | (trailSurrogate & 1023)
+ }
+ HEAP32[outPtr >> 2] = codeUnit
+ outPtr += 4
+ if (outPtr + 4 > endPtr) break
+ }
+ HEAP32[outPtr >> 2] = 0
+ return outPtr - startPtr
+ }
+ function lengthBytesUTF32(str) {
+ var len = 0
+ for (var i = 0; i < str.length; ++i) {
+ var codeUnit = str.charCodeAt(i)
+ if (codeUnit >= 55296 && codeUnit <= 57343) ++i
+ len += 4
+ }
+ return len
+ }
+ function alignUp(x, multiple) {
+ if (x % multiple > 0) {
+ x += multiple - (x % multiple)
+ }
+ return x
+ }
+ var buffer,
+ HEAP8,
+ HEAPU8,
+ HEAP16,
+ HEAPU16,
+ HEAP32,
+ HEAPU32,
+ HEAPF32,
+ HEAPF64
+ function updateGlobalBufferAndViews(buf) {
+ buffer = buf
+ Module['HEAP8'] = HEAP8 = new Int8Array(buf)
+ Module['HEAP16'] = HEAP16 = new Int16Array(buf)
+ Module['HEAP32'] = HEAP32 = new Int32Array(buf)
+ Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf)
+ Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf)
+ Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf)
+ Module['HEAPF32'] = HEAPF32 = new Float32Array(buf)
+ Module['HEAPF64'] = HEAPF64 = new Float64Array(buf)
+ }
+ var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216
+ var wasmTable
+ var __ATPRERUN__ = []
+ var __ATINIT__ = []
+ var __ATPOSTRUN__ = []
+ var runtimeInitialized = false
+ function preRun() {
+ if (Module['preRun']) {
+ if (typeof Module['preRun'] == 'function')
+ Module['preRun'] = [Module['preRun']]
+ while (Module['preRun'].length) {
+ addOnPreRun(Module['preRun'].shift())
+ }
+ }
+ callRuntimeCallbacks(__ATPRERUN__)
+ }
+ function initRuntime() {
+ runtimeInitialized = true
+ callRuntimeCallbacks(__ATINIT__)
+ }
+ function postRun() {
+ if (Module['postRun']) {
+ if (typeof Module['postRun'] == 'function')
+ Module['postRun'] = [Module['postRun']]
+ while (Module['postRun'].length) {
+ addOnPostRun(Module['postRun'].shift())
+ }
+ }
+ callRuntimeCallbacks(__ATPOSTRUN__)
+ }
+ function addOnPreRun(cb) {
+ __ATPRERUN__.unshift(cb)
+ }
+ function addOnInit(cb) {
+ __ATINIT__.unshift(cb)
+ }
+ function addOnPostRun(cb) {
+ __ATPOSTRUN__.unshift(cb)
+ }
+ var runDependencies = 0
+ var runDependencyWatcher = null
+ var dependenciesFulfilled = null
+ function addRunDependency(id) {
+ runDependencies++
+ if (Module['monitorRunDependencies']) {
+ Module['monitorRunDependencies'](runDependencies)
+ }
+ }
+ function removeRunDependency(id) {
+ runDependencies--
+ if (Module['monitorRunDependencies']) {
+ Module['monitorRunDependencies'](runDependencies)
+ }
+ if (runDependencies == 0) {
+ if (runDependencyWatcher !== null) {
+ clearInterval(runDependencyWatcher)
+ runDependencyWatcher = null
+ }
+ if (dependenciesFulfilled) {
+ var callback = dependenciesFulfilled
+ dependenciesFulfilled = null
+ callback()
+ }
+ }
+ }
+ Module['preloadedImages'] = {}
+ Module['preloadedAudios'] = {}
+ function abort(what) {
+ if (Module['onAbort']) {
+ Module['onAbort'](what)
+ }
+ what += ''
+ err(what)
+ ABORT = true
+ EXITSTATUS = 1
+ what = 'abort(' + what + '). Build with -s ASSERTIONS=1 for more info.'
+ var e = new WebAssembly.RuntimeError(what)
+ readyPromiseReject(e)
+ throw e
+ }
+ var dataURIPrefix = 'data:application/octet-stream;base64,'
+ function isDataURI(filename) {
+ return filename.startsWith(dataURIPrefix)
+ }
+ if (Module['locateFile']) {
+ var wasmBinaryFile = 'avif_node_dec.wasm'
+ if (!isDataURI(wasmBinaryFile)) {
+ wasmBinaryFile = locateFile(wasmBinaryFile)
+ }
+ } else {
+ throw new Error('invariant')
+ }
+ function getBinary(file) {
+ try {
+ if (file == wasmBinaryFile && wasmBinary) {
+ return new Uint8Array(wasmBinary)
+ }
+ if (readBinary) {
+ return readBinary(file)
+ } else {
+ throw 'both async and sync fetching of the wasm failed'
+ }
+ } catch (err) {
+ abort(err)
+ }
+ }
+ function getBinaryPromise() {
+ if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
+ if (typeof fetch === 'function') {
+ return fetch(wasmBinaryFile, { credentials: 'same-origin' })
+ .then(function (response) {
+ if (!response['ok']) {
+ throw (
+ "failed to load wasm binary file at '" + wasmBinaryFile + "'"
+ )
+ }
+ return response['arrayBuffer']()
+ })
+ .catch(function () {
+ return getBinary(wasmBinaryFile)
+ })
+ }
+ }
+ return Promise.resolve().then(function () {
+ return getBinary(wasmBinaryFile)
+ })
+ }
+ function createWasm() {
+ var info = { a: asmLibraryArg }
+ function receiveInstance(instance, module) {
+ var exports = instance.exports
+ Module['asm'] = exports
+ wasmMemory = Module['asm']['C']
+ updateGlobalBufferAndViews(wasmMemory.buffer)
+ wasmTable = Module['asm']['L']
+ addOnInit(Module['asm']['D'])
+ removeRunDependency('wasm-instantiate')
+ }
+ addRunDependency('wasm-instantiate')
+ function receiveInstantiationResult(result) {
+ receiveInstance(result['instance'])
+ }
+ function instantiateArrayBuffer(receiver) {
+ return getBinaryPromise()
+ .then(function (binary) {
+ var result = WebAssembly.instantiate(binary, info)
+ return result
+ })
+ .then(receiver, function (reason) {
+ err('failed to asynchronously prepare wasm: ' + reason)
+ abort(reason)
+ })
+ }
+ function instantiateAsync() {
+ if (
+ !wasmBinary &&
+ typeof WebAssembly.instantiateStreaming === 'function' &&
+ !isDataURI(wasmBinaryFile) &&
+ typeof fetch === 'function'
+ ) {
+ return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(
+ function (response) {
+ var result = WebAssembly.instantiateStreaming(response, info)
+ return result.then(receiveInstantiationResult, function (reason) {
+ err('wasm streaming compile failed: ' + reason)
+ err('falling back to ArrayBuffer instantiation')
+ return instantiateArrayBuffer(receiveInstantiationResult)
+ })
+ }
+ )
+ } else {
+ return instantiateArrayBuffer(receiveInstantiationResult)
+ }
+ }
+ if (Module['instantiateWasm']) {
+ try {
+ var exports = Module['instantiateWasm'](info, receiveInstance)
+ return exports
+ } catch (e) {
+ err('Module.instantiateWasm callback failed with error: ' + e)
+ return false
+ }
+ }
+ instantiateAsync().catch(readyPromiseReject)
+ return {}
+ }
+ function callRuntimeCallbacks(callbacks) {
+ while (callbacks.length > 0) {
+ var callback = callbacks.shift()
+ if (typeof callback == 'function') {
+ callback(Module)
+ continue
+ }
+ var func = callback.func
+ if (typeof func === 'number') {
+ if (callback.arg === undefined) {
+ wasmTable.get(func)()
+ } else {
+ wasmTable.get(func)(callback.arg)
+ }
+ } else {
+ func(callback.arg === undefined ? null : callback.arg)
+ }
+ }
+ }
+ function _atexit(func, arg) {}
+ function ___cxa_thread_atexit(a0, a1) {
+ return _atexit(a0, a1)
+ }
+ function __embind_register_bigint(
+ primitiveType,
+ name,
+ size,
+ minRange,
+ maxRange
+ ) {}
+ function getShiftFromSize(size) {
+ switch (size) {
+ case 1:
+ return 0
+ case 2:
+ return 1
+ case 4:
+ return 2
+ case 8:
+ return 3
+ default:
+ throw new TypeError('Unknown type size: ' + size)
+ }
+ }
+ function embind_init_charCodes() {
+ var codes = new Array(256)
+ for (var i = 0; i < 256; ++i) {
+ codes[i] = String.fromCharCode(i)
+ }
+ embind_charCodes = codes
+ }
+ var embind_charCodes = undefined
+ function readLatin1String(ptr) {
+ var ret = ''
+ var c = ptr
+ while (HEAPU8[c]) {
+ ret += embind_charCodes[HEAPU8[c++]]
+ }
+ return ret
+ }
+ var awaitingDependencies = {}
+ var registeredTypes = {}
+ var typeDependencies = {}
+ var char_0 = 48
+ var char_9 = 57
+ function makeLegalFunctionName(name) {
+ if (undefined === name) {
+ return '_unknown'
+ }
+ name = name.replace(/[^a-zA-Z0-9_]/g, '$')
+ var f = name.charCodeAt(0)
+ if (f >= char_0 && f <= char_9) {
+ return '_' + name
+ } else {
+ return name
+ }
+ }
+ function createNamedFunction(name, body) {
+ name = makeLegalFunctionName(name)
+ return new Function(
+ 'body',
+ 'return function ' +
+ name +
+ '() {\n' +
+ ' "use strict";' +
+ ' return body.apply(this, arguments);\n' +
+ '};\n'
+ )(body)
+ }
+ function extendError(baseErrorType, errorName) {
+ var errorClass = createNamedFunction(errorName, function (message) {
+ this.name = errorName
+ this.message = message
+ var stack = new Error(message).stack
+ if (stack !== undefined) {
+ this.stack =
+ this.toString() + '\n' + stack.replace(/^Error(:[^\n]*)?\n/, '')
+ }
+ })
+ errorClass.prototype = Object.create(baseErrorType.prototype)
+ errorClass.prototype.constructor = errorClass
+ errorClass.prototype.toString = function () {
+ if (this.message === undefined) {
+ return this.name
+ } else {
+ return this.name + ': ' + this.message
+ }
+ }
+ return errorClass
+ }
+ var BindingError = undefined
+ function throwBindingError(message) {
+ throw new BindingError(message)
+ }
+ var InternalError = undefined
+ function throwInternalError(message) {
+ throw new InternalError(message)
+ }
+ function whenDependentTypesAreResolved(
+ myTypes,
+ dependentTypes,
+ getTypeConverters
+ ) {
+ myTypes.forEach(function (type) {
+ typeDependencies[type] = dependentTypes
+ })
+ function onComplete(typeConverters) {
+ var myTypeConverters = getTypeConverters(typeConverters)
+ if (myTypeConverters.length !== myTypes.length) {
+ throwInternalError('Mismatched type converter count')
+ }
+ for (var i = 0; i < myTypes.length; ++i) {
+ registerType(myTypes[i], myTypeConverters[i])
+ }
+ }
+ var typeConverters = new Array(dependentTypes.length)
+ var unregisteredTypes = []
+ var registered = 0
+ dependentTypes.forEach(function (dt, i) {
+ if (registeredTypes.hasOwnProperty(dt)) {
+ typeConverters[i] = registeredTypes[dt]
+ } else {
+ unregisteredTypes.push(dt)
+ if (!awaitingDependencies.hasOwnProperty(dt)) {
+ awaitingDependencies[dt] = []
+ }
+ awaitingDependencies[dt].push(function () {
+ typeConverters[i] = registeredTypes[dt]
+ ++registered
+ if (registered === unregisteredTypes.length) {
+ onComplete(typeConverters)
+ }
+ })
+ }
+ })
+ if (0 === unregisteredTypes.length) {
+ onComplete(typeConverters)
+ }
+ }
+ function registerType(rawType, registeredInstance, options) {
+ options = options || {}
+ if (!('argPackAdvance' in registeredInstance)) {
+ throw new TypeError(
+ 'registerType registeredInstance requires argPackAdvance'
+ )
+ }
+ var name = registeredInstance.name
+ if (!rawType) {
+ throwBindingError(
+ 'type "' + name + '" must have a positive integer typeid pointer'
+ )
+ }
+ if (registeredTypes.hasOwnProperty(rawType)) {
+ if (options.ignoreDuplicateRegistrations) {
+ return
+ } else {
+ throwBindingError("Cannot register type '" + name + "' twice")
+ }
+ }
+ registeredTypes[rawType] = registeredInstance
+ delete typeDependencies[rawType]
+ if (awaitingDependencies.hasOwnProperty(rawType)) {
+ var callbacks = awaitingDependencies[rawType]
+ delete awaitingDependencies[rawType]
+ callbacks.forEach(function (cb) {
+ cb()
+ })
+ }
+ }
+ function __embind_register_bool(
+ rawType,
+ name,
+ size,
+ trueValue,
+ falseValue
+ ) {
+ var shift = getShiftFromSize(size)
+ name = readLatin1String(name)
+ registerType(rawType, {
+ name: name,
+ fromWireType: function (wt) {
+ return !!wt
+ },
+ toWireType: function (destructors, o) {
+ return o ? trueValue : falseValue
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: function (pointer) {
+ var heap
+ if (size === 1) {
+ heap = HEAP8
+ } else if (size === 2) {
+ heap = HEAP16
+ } else if (size === 4) {
+ heap = HEAP32
+ } else {
+ throw new TypeError('Unknown boolean type size: ' + name)
+ }
+ return this['fromWireType'](heap[pointer >> shift])
+ },
+ destructorFunction: null,
+ })
+ }
+ var emval_free_list = []
+ var emval_handle_array = [
+ {},
+ { value: undefined },
+ { value: null },
+ { value: true },
+ { value: false },
+ ]
+ function __emval_decref(handle) {
+ if (handle > 4 && 0 === --emval_handle_array[handle].refcount) {
+ emval_handle_array[handle] = undefined
+ emval_free_list.push(handle)
+ }
+ }
+ function count_emval_handles() {
+ var count = 0
+ for (var i = 5; i < emval_handle_array.length; ++i) {
+ if (emval_handle_array[i] !== undefined) {
+ ++count
+ }
+ }
+ return count
+ }
+ function get_first_emval() {
+ for (var i = 5; i < emval_handle_array.length; ++i) {
+ if (emval_handle_array[i] !== undefined) {
+ return emval_handle_array[i]
+ }
+ }
+ return null
+ }
+ function init_emval() {
+ Module['count_emval_handles'] = count_emval_handles
+ Module['get_first_emval'] = get_first_emval
+ }
+ function __emval_register(value) {
+ switch (value) {
+ case undefined: {
+ return 1
+ }
+ case null: {
+ return 2
+ }
+ case true: {
+ return 3
+ }
+ case false: {
+ return 4
+ }
+ default: {
+ var handle = emval_free_list.length
+ ? emval_free_list.pop()
+ : emval_handle_array.length
+ emval_handle_array[handle] = { refcount: 1, value: value }
+ return handle
+ }
+ }
+ }
+ function simpleReadValueFromPointer(pointer) {
+ return this['fromWireType'](HEAPU32[pointer >> 2])
+ }
+ function __embind_register_emval(rawType, name) {
+ name = readLatin1String(name)
+ registerType(rawType, {
+ name: name,
+ fromWireType: function (handle) {
+ var rv = emval_handle_array[handle].value
+ __emval_decref(handle)
+ return rv
+ },
+ toWireType: function (destructors, value) {
+ return __emval_register(value)
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: simpleReadValueFromPointer,
+ destructorFunction: null,
+ })
+ }
+ function _embind_repr(v) {
+ if (v === null) {
+ return 'null'
+ }
+ var t = typeof v
+ if (t === 'object' || t === 'array' || t === 'function') {
+ return v.toString()
+ } else {
+ return '' + v
+ }
+ }
+ function floatReadValueFromPointer(name, shift) {
+ switch (shift) {
+ case 2:
+ return function (pointer) {
+ return this['fromWireType'](HEAPF32[pointer >> 2])
+ }
+ case 3:
+ return function (pointer) {
+ return this['fromWireType'](HEAPF64[pointer >> 3])
+ }
+ default:
+ throw new TypeError('Unknown float type: ' + name)
+ }
+ }
+ function __embind_register_float(rawType, name, size) {
+ var shift = getShiftFromSize(size)
+ name = readLatin1String(name)
+ registerType(rawType, {
+ name: name,
+ fromWireType: function (value) {
+ return value
+ },
+ toWireType: function (destructors, value) {
+ if (typeof value !== 'number' && typeof value !== 'boolean') {
+ throw new TypeError(
+ 'Cannot convert "' + _embind_repr(value) + '" to ' + this.name
+ )
+ }
+ return value
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: floatReadValueFromPointer(name, shift),
+ destructorFunction: null,
+ })
+ }
+ function new_(constructor, argumentList) {
+ if (!(constructor instanceof Function)) {
+ throw new TypeError(
+ 'new_ called with constructor type ' +
+ typeof constructor +
+ ' which is not a function'
+ )
+ }
+ var dummy = createNamedFunction(
+ constructor.name || 'unknownFunctionName',
+ function () {}
+ )
+ dummy.prototype = constructor.prototype
+ var obj = new dummy()
+ var r = constructor.apply(obj, argumentList)
+ return r instanceof Object ? r : obj
+ }
+ function runDestructors(destructors) {
+ while (destructors.length) {
+ var ptr = destructors.pop()
+ var del = destructors.pop()
+ del(ptr)
+ }
+ }
+ function craftInvokerFunction(
+ humanName,
+ argTypes,
+ classType,
+ cppInvokerFunc,
+ cppTargetFunc
+ ) {
+ var argCount = argTypes.length
+ if (argCount < 2) {
+ throwBindingError(
+ "argTypes array size mismatch! Must at least get return value and 'this' types!"
+ )
+ }
+ var isClassMethodFunc = argTypes[1] !== null && classType !== null
+ var needsDestructorStack = false
+ for (var i = 1; i < argTypes.length; ++i) {
+ if (
+ argTypes[i] !== null &&
+ argTypes[i].destructorFunction === undefined
+ ) {
+ needsDestructorStack = true
+ break
+ }
+ }
+ var returns = argTypes[0].name !== 'void'
+ var argsList = ''
+ var argsListWired = ''
+ for (var i = 0; i < argCount - 2; ++i) {
+ argsList += (i !== 0 ? ', ' : '') + 'arg' + i
+ argsListWired += (i !== 0 ? ', ' : '') + 'arg' + i + 'Wired'
+ }
+ var invokerFnBody =
+ 'return function ' +
+ makeLegalFunctionName(humanName) +
+ '(' +
+ argsList +
+ ') {\n' +
+ 'if (arguments.length !== ' +
+ (argCount - 2) +
+ ') {\n' +
+ "throwBindingError('function " +
+ humanName +
+ " called with ' + arguments.length + ' arguments, expected " +
+ (argCount - 2) +
+ " args!');\n" +
+ '}\n'
+ if (needsDestructorStack) {
+ invokerFnBody += 'var destructors = [];\n'
+ }
+ var dtorStack = needsDestructorStack ? 'destructors' : 'null'
+ var args1 = [
+ 'throwBindingError',
+ 'invoker',
+ 'fn',
+ 'runDestructors',
+ 'retType',
+ 'classParam',
+ ]
+ var args2 = [
+ throwBindingError,
+ cppInvokerFunc,
+ cppTargetFunc,
+ runDestructors,
+ argTypes[0],
+ argTypes[1],
+ ]
+ if (isClassMethodFunc) {
+ invokerFnBody +=
+ 'var thisWired = classParam.toWireType(' + dtorStack + ', this);\n'
+ }
+ for (var i = 0; i < argCount - 2; ++i) {
+ invokerFnBody +=
+ 'var arg' +
+ i +
+ 'Wired = argType' +
+ i +
+ '.toWireType(' +
+ dtorStack +
+ ', arg' +
+ i +
+ '); // ' +
+ argTypes[i + 2].name +
+ '\n'
+ args1.push('argType' + i)
+ args2.push(argTypes[i + 2])
+ }
+ if (isClassMethodFunc) {
+ argsListWired =
+ 'thisWired' + (argsListWired.length > 0 ? ', ' : '') + argsListWired
+ }
+ invokerFnBody +=
+ (returns ? 'var rv = ' : '') +
+ 'invoker(fn' +
+ (argsListWired.length > 0 ? ', ' : '') +
+ argsListWired +
+ ');\n'
+ if (needsDestructorStack) {
+ invokerFnBody += 'runDestructors(destructors);\n'
+ } else {
+ for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
+ var paramName = i === 1 ? 'thisWired' : 'arg' + (i - 2) + 'Wired'
+ if (argTypes[i].destructorFunction !== null) {
+ invokerFnBody +=
+ paramName +
+ '_dtor(' +
+ paramName +
+ '); // ' +
+ argTypes[i].name +
+ '\n'
+ args1.push(paramName + '_dtor')
+ args2.push(argTypes[i].destructorFunction)
+ }
+ }
+ }
+ if (returns) {
+ invokerFnBody +=
+ 'var ret = retType.fromWireType(rv);\n' + 'return ret;\n'
+ } else {
+ }
+ invokerFnBody += '}\n'
+ args1.push(invokerFnBody)
+ var invokerFunction = new_(Function, args1).apply(null, args2)
+ return invokerFunction
+ }
+ function ensureOverloadTable(proto, methodName, humanName) {
+ if (undefined === proto[methodName].overloadTable) {
+ var prevFunc = proto[methodName]
+ proto[methodName] = function () {
+ if (
+ !proto[methodName].overloadTable.hasOwnProperty(arguments.length)
+ ) {
+ throwBindingError(
+ "Function '" +
+ humanName +
+ "' called with an invalid number of arguments (" +
+ arguments.length +
+ ') - expects one of (' +
+ proto[methodName].overloadTable +
+ ')!'
+ )
+ }
+ return proto[methodName].overloadTable[arguments.length].apply(
+ this,
+ arguments
+ )
+ }
+ proto[methodName].overloadTable = []
+ proto[methodName].overloadTable[prevFunc.argCount] = prevFunc
+ }
+ }
+ function exposePublicSymbol(name, value, numArguments) {
+ if (Module.hasOwnProperty(name)) {
+ if (
+ undefined === numArguments ||
+ (undefined !== Module[name].overloadTable &&
+ undefined !== Module[name].overloadTable[numArguments])
+ ) {
+ throwBindingError("Cannot register public name '" + name + "' twice")
+ }
+ ensureOverloadTable(Module, name, name)
+ if (Module.hasOwnProperty(numArguments)) {
+ throwBindingError(
+ 'Cannot register multiple overloads of a function with the same number of arguments (' +
+ numArguments +
+ ')!'
+ )
+ }
+ Module[name].overloadTable[numArguments] = value
+ } else {
+ Module[name] = value
+ if (undefined !== numArguments) {
+ Module[name].numArguments = numArguments
+ }
+ }
+ }
+ function heap32VectorToArray(count, firstElement) {
+ var array = []
+ for (var i = 0; i < count; i++) {
+ array.push(HEAP32[(firstElement >> 2) + i])
+ }
+ return array
+ }
+ function replacePublicSymbol(name, value, numArguments) {
+ if (!Module.hasOwnProperty(name)) {
+ throwInternalError('Replacing nonexistant public symbol')
+ }
+ if (
+ undefined !== Module[name].overloadTable &&
+ undefined !== numArguments
+ ) {
+ Module[name].overloadTable[numArguments] = value
+ } else {
+ Module[name] = value
+ Module[name].argCount = numArguments
+ }
+ }
+ function dynCallLegacy(sig, ptr, args) {
+ var f = Module['dynCall_' + sig]
+ return args && args.length
+ ? f.apply(null, [ptr].concat(args))
+ : f.call(null, ptr)
+ }
+ function dynCall(sig, ptr, args) {
+ if (sig.includes('j')) {
+ return dynCallLegacy(sig, ptr, args)
+ }
+ return wasmTable.get(ptr).apply(null, args)
+ }
+ function getDynCaller(sig, ptr) {
+ var argCache = []
+ return function () {
+ argCache.length = arguments.length
+ for (var i = 0; i < arguments.length; i++) {
+ argCache[i] = arguments[i]
+ }
+ return dynCall(sig, ptr, argCache)
+ }
+ }
+ function embind__requireFunction(signature, rawFunction) {
+ signature = readLatin1String(signature)
+ function makeDynCaller() {
+ if (signature.includes('j')) {
+ return getDynCaller(signature, rawFunction)
+ }
+ return wasmTable.get(rawFunction)
+ }
+ var fp = makeDynCaller()
+ if (typeof fp !== 'function') {
+ throwBindingError(
+ 'unknown function pointer with signature ' +
+ signature +
+ ': ' +
+ rawFunction
+ )
+ }
+ return fp
+ }
+ var UnboundTypeError = undefined
+ function getTypeName(type) {
+ var ptr = ___getTypeName(type)
+ var rv = readLatin1String(ptr)
+ _free(ptr)
+ return rv
+ }
+ function throwUnboundTypeError(message, types) {
+ var unboundTypes = []
+ var seen = {}
+ function visit(type) {
+ if (seen[type]) {
+ return
+ }
+ if (registeredTypes[type]) {
+ return
+ }
+ if (typeDependencies[type]) {
+ typeDependencies[type].forEach(visit)
+ return
+ }
+ unboundTypes.push(type)
+ seen[type] = true
+ }
+ types.forEach(visit)
+ throw new UnboundTypeError(
+ message + ': ' + unboundTypes.map(getTypeName).join([', '])
+ )
+ }
+ function __embind_register_function(
+ name,
+ argCount,
+ rawArgTypesAddr,
+ signature,
+ rawInvoker,
+ fn
+ ) {
+ var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr)
+ name = readLatin1String(name)
+ rawInvoker = embind__requireFunction(signature, rawInvoker)
+ exposePublicSymbol(
+ name,
+ function () {
+ throwUnboundTypeError(
+ 'Cannot call ' + name + ' due to unbound types',
+ argTypes
+ )
+ },
+ argCount - 1
+ )
+ whenDependentTypesAreResolved([], argTypes, function (argTypes) {
+ var invokerArgsArray = [argTypes[0], null].concat(argTypes.slice(1))
+ replacePublicSymbol(
+ name,
+ craftInvokerFunction(name, invokerArgsArray, null, rawInvoker, fn),
+ argCount - 1
+ )
+ return []
+ })
+ }
+ function integerReadValueFromPointer(name, shift, signed) {
+ switch (shift) {
+ case 0:
+ return signed
+ ? function readS8FromPointer(pointer) {
+ return HEAP8[pointer]
+ }
+ : function readU8FromPointer(pointer) {
+ return HEAPU8[pointer]
+ }
+ case 1:
+ return signed
+ ? function readS16FromPointer(pointer) {
+ return HEAP16[pointer >> 1]
+ }
+ : function readU16FromPointer(pointer) {
+ return HEAPU16[pointer >> 1]
+ }
+ case 2:
+ return signed
+ ? function readS32FromPointer(pointer) {
+ return HEAP32[pointer >> 2]
+ }
+ : function readU32FromPointer(pointer) {
+ return HEAPU32[pointer >> 2]
+ }
+ default:
+ throw new TypeError('Unknown integer type: ' + name)
+ }
+ }
+ function __embind_register_integer(
+ primitiveType,
+ name,
+ size,
+ minRange,
+ maxRange
+ ) {
+ name = readLatin1String(name)
+ if (maxRange === -1) {
+ maxRange = 4294967295
+ }
+ var shift = getShiftFromSize(size)
+ var fromWireType = function (value) {
+ return value
+ }
+ if (minRange === 0) {
+ var bitshift = 32 - 8 * size
+ fromWireType = function (value) {
+ return (value << bitshift) >>> bitshift
+ }
+ }
+ var isUnsignedType = name.includes('unsigned')
+ registerType(primitiveType, {
+ name: name,
+ fromWireType: fromWireType,
+ toWireType: function (destructors, value) {
+ if (typeof value !== 'number' && typeof value !== 'boolean') {
+ throw new TypeError(
+ 'Cannot convert "' + _embind_repr(value) + '" to ' + this.name
+ )
+ }
+ if (value < minRange || value > maxRange) {
+ throw new TypeError(
+ 'Passing a number "' +
+ _embind_repr(value) +
+ '" from JS side to C/C++ side to an argument of type "' +
+ name +
+ '", which is outside the valid range [' +
+ minRange +
+ ', ' +
+ maxRange +
+ ']!'
+ )
+ }
+ return isUnsignedType ? value >>> 0 : value | 0
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: integerReadValueFromPointer(
+ name,
+ shift,
+ minRange !== 0
+ ),
+ destructorFunction: null,
+ })
+ }
+ function __embind_register_memory_view(rawType, dataTypeIndex, name) {
+ var typeMapping = [
+ Int8Array,
+ Uint8Array,
+ Int16Array,
+ Uint16Array,
+ Int32Array,
+ Uint32Array,
+ Float32Array,
+ Float64Array,
+ ]
+ var TA = typeMapping[dataTypeIndex]
+ function decodeMemoryView(handle) {
+ handle = handle >> 2
+ var heap = HEAPU32
+ var size = heap[handle]
+ var data = heap[handle + 1]
+ return new TA(buffer, data, size)
+ }
+ name = readLatin1String(name)
+ registerType(
+ rawType,
+ {
+ name: name,
+ fromWireType: decodeMemoryView,
+ argPackAdvance: 8,
+ readValueFromPointer: decodeMemoryView,
+ },
+ { ignoreDuplicateRegistrations: true }
+ )
+ }
+ function __embind_register_std_string(rawType, name) {
+ name = readLatin1String(name)
+ var stdStringIsUTF8 = name === 'std::string'
+ registerType(rawType, {
+ name: name,
+ fromWireType: function (value) {
+ var length = HEAPU32[value >> 2]
+ var str
+ if (stdStringIsUTF8) {
+ var decodeStartPtr = value + 4
+ for (var i = 0; i <= length; ++i) {
+ var currentBytePtr = value + 4 + i
+ if (i == length || HEAPU8[currentBytePtr] == 0) {
+ var maxRead = currentBytePtr - decodeStartPtr
+ var stringSegment = UTF8ToString(decodeStartPtr, maxRead)
+ if (str === undefined) {
+ str = stringSegment
+ } else {
+ str += String.fromCharCode(0)
+ str += stringSegment
+ }
+ decodeStartPtr = currentBytePtr + 1
+ }
+ }
+ } else {
+ var a = new Array(length)
+ for (var i = 0; i < length; ++i) {
+ a[i] = String.fromCharCode(HEAPU8[value + 4 + i])
+ }
+ str = a.join('')
+ }
+ _free(value)
+ return str
+ },
+ toWireType: function (destructors, value) {
+ if (value instanceof ArrayBuffer) {
+ value = new Uint8Array(value)
+ }
+ var getLength
+ var valueIsOfTypeString = typeof value === 'string'
+ if (
+ !(
+ valueIsOfTypeString ||
+ value instanceof Uint8Array ||
+ value instanceof Uint8ClampedArray ||
+ value instanceof Int8Array
+ )
+ ) {
+ throwBindingError('Cannot pass non-string to std::string')
+ }
+ if (stdStringIsUTF8 && valueIsOfTypeString) {
+ getLength = function () {
+ return lengthBytesUTF8(value)
+ }
+ } else {
+ getLength = function () {
+ return value.length
+ }
+ }
+ var length = getLength()
+ var ptr = _malloc(4 + length + 1)
+ HEAPU32[ptr >> 2] = length
+ if (stdStringIsUTF8 && valueIsOfTypeString) {
+ stringToUTF8(value, ptr + 4, length + 1)
+ } else {
+ if (valueIsOfTypeString) {
+ for (var i = 0; i < length; ++i) {
+ var charCode = value.charCodeAt(i)
+ if (charCode > 255) {
+ _free(ptr)
+ throwBindingError(
+ 'String has UTF-16 code units that do not fit in 8 bits'
+ )
+ }
+ HEAPU8[ptr + 4 + i] = charCode
+ }
+ } else {
+ for (var i = 0; i < length; ++i) {
+ HEAPU8[ptr + 4 + i] = value[i]
+ }
+ }
+ }
+ if (destructors !== null) {
+ destructors.push(_free, ptr)
+ }
+ return ptr
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: simpleReadValueFromPointer,
+ destructorFunction: function (ptr) {
+ _free(ptr)
+ },
+ })
+ }
+ function __embind_register_std_wstring(rawType, charSize, name) {
+ name = readLatin1String(name)
+ var decodeString, encodeString, getHeap, lengthBytesUTF, shift
+ if (charSize === 2) {
+ decodeString = UTF16ToString
+ encodeString = stringToUTF16
+ lengthBytesUTF = lengthBytesUTF16
+ getHeap = function () {
+ return HEAPU16
+ }
+ shift = 1
+ } else if (charSize === 4) {
+ decodeString = UTF32ToString
+ encodeString = stringToUTF32
+ lengthBytesUTF = lengthBytesUTF32
+ getHeap = function () {
+ return HEAPU32
+ }
+ shift = 2
+ }
+ registerType(rawType, {
+ name: name,
+ fromWireType: function (value) {
+ var length = HEAPU32[value >> 2]
+ var HEAP = getHeap()
+ var str
+ var decodeStartPtr = value + 4
+ for (var i = 0; i <= length; ++i) {
+ var currentBytePtr = value + 4 + i * charSize
+ if (i == length || HEAP[currentBytePtr >> shift] == 0) {
+ var maxReadBytes = currentBytePtr - decodeStartPtr
+ var stringSegment = decodeString(decodeStartPtr, maxReadBytes)
+ if (str === undefined) {
+ str = stringSegment
+ } else {
+ str += String.fromCharCode(0)
+ str += stringSegment
+ }
+ decodeStartPtr = currentBytePtr + charSize
+ }
+ }
+ _free(value)
+ return str
+ },
+ toWireType: function (destructors, value) {
+ if (!(typeof value === 'string')) {
+ throwBindingError(
+ 'Cannot pass non-string to C++ string type ' + name
+ )
+ }
+ var length = lengthBytesUTF(value)
+ var ptr = _malloc(4 + length + charSize)
+ HEAPU32[ptr >> 2] = length >> shift
+ encodeString(value, ptr + 4, length + charSize)
+ if (destructors !== null) {
+ destructors.push(_free, ptr)
+ }
+ return ptr
+ },
+ argPackAdvance: 8,
+ readValueFromPointer: simpleReadValueFromPointer,
+ destructorFunction: function (ptr) {
+ _free(ptr)
+ },
+ })
+ }
+ function __embind_register_void(rawType, name) {
+ name = readLatin1String(name)
+ registerType(rawType, {
+ isVoid: true,
+ name: name,
+ argPackAdvance: 0,
+ fromWireType: function () {
+ return undefined
+ },
+ toWireType: function (destructors, o) {
+ return undefined
+ },
+ })
+ }
+ var emval_symbols = {}
+ function getStringOrSymbol(address) {
+ var symbol = emval_symbols[address]
+ if (symbol === undefined) {
+ return readLatin1String(address)
+ } else {
+ return symbol
+ }
+ }
+ function emval_get_global() {
+ if (typeof globalThis === 'object') {
+ return globalThis
+ }
+ return (function () {
+ return Function
+ })()('return this')()
+ }
+ function __emval_get_global(name) {
+ if (name === 0) {
+ return __emval_register(emval_get_global())
+ } else {
+ name = getStringOrSymbol(name)
+ return __emval_register(emval_get_global()[name])
+ }
+ }
+ function __emval_incref(handle) {
+ if (handle > 4) {
+ emval_handle_array[handle].refcount += 1
+ }
+ }
+ function requireRegisteredType(rawType, humanName) {
+ var impl = registeredTypes[rawType]
+ if (undefined === impl) {
+ throwBindingError(
+ humanName + ' has unknown type ' + getTypeName(rawType)
+ )
+ }
+ return impl
+ }
+ function craftEmvalAllocator(argCount) {
+ var argsList = ''
+ for (var i = 0; i < argCount; ++i) {
+ argsList += (i !== 0 ? ', ' : '') + 'arg' + i
+ }
+ var functionBody =
+ 'return function emval_allocator_' +
+ argCount +
+ '(constructor, argTypes, args) {\n'
+ for (var i = 0; i < argCount; ++i) {
+ functionBody +=
+ 'var argType' +
+ i +
+ " = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + " +
+ i +
+ '], "parameter ' +
+ i +
+ '");\n' +
+ 'var arg' +
+ i +
+ ' = argType' +
+ i +
+ '.readValueFromPointer(args);\n' +
+ 'args += argType' +
+ i +
+ "['argPackAdvance'];\n"
+ }
+ functionBody +=
+ 'var obj = new constructor(' +
+ argsList +
+ ');\n' +
+ 'return __emval_register(obj);\n' +
+ '}\n'
+ return new Function(
+ 'requireRegisteredType',
+ 'Module',
+ '__emval_register',
+ functionBody
+ )(requireRegisteredType, Module, __emval_register)
+ }
+ var emval_newers = {}
+ function requireHandle(handle) {
+ if (!handle) {
+ throwBindingError('Cannot use deleted val. handle = ' + handle)
+ }
+ return emval_handle_array[handle].value
+ }
+ function __emval_new(handle, argCount, argTypes, args) {
+ handle = requireHandle(handle)
+ var newer = emval_newers[argCount]
+ if (!newer) {
+ newer = craftEmvalAllocator(argCount)
+ emval_newers[argCount] = newer
+ }
+ return newer(handle, argTypes, args)
+ }
+ function _abort() {
+ abort()
+ }
+ function _longjmp(env, value) {
+ _setThrew(env, value || 1)
+ throw 'longjmp'
+ }
+ function _emscripten_longjmp(a0, a1) {
+ return _longjmp(a0, a1)
+ }
+ function _emscripten_memcpy_big(dest, src, num) {
+ HEAPU8.copyWithin(dest, src, src + num)
+ }
+ function emscripten_realloc_buffer(size) {
+ try {
+ wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16)
+ updateGlobalBufferAndViews(wasmMemory.buffer)
+ return 1
+ } catch (e) {}
+ }
+ function _emscripten_resize_heap(requestedSize) {
+ var oldSize = HEAPU8.length
+ requestedSize = requestedSize >>> 0
+ var maxHeapSize = 2147483648
+ if (requestedSize > maxHeapSize) {
+ return false
+ }
+ for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
+ var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown)
+ overGrownHeapSize = Math.min(
+ overGrownHeapSize,
+ requestedSize + 100663296
+ )
+ var newSize = Math.min(
+ maxHeapSize,
+ alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)
+ )
+ var replacement = emscripten_realloc_buffer(newSize)
+ if (replacement) {
+ return true
+ }
+ }
+ return false
+ }
+ var SYSCALLS = {
+ mappings: {},
+ buffers: [null, [], []],
+ printChar: function (stream, curr) {
+ var buffer = SYSCALLS.buffers[stream]
+ if (curr === 0 || curr === 10) {
+ ;(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0))
+ buffer.length = 0
+ } else {
+ buffer.push(curr)
+ }
+ },
+ varargs: undefined,
+ get: function () {
+ SYSCALLS.varargs += 4
+ var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2]
+ return ret
+ },
+ getStr: function (ptr) {
+ var ret = UTF8ToString(ptr)
+ return ret
+ },
+ get64: function (low, high) {
+ return low
+ },
+ }
+ function _fd_close(fd) {
+ return 0
+ }
+ function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {}
+ function _fd_write(fd, iov, iovcnt, pnum) {
+ var num = 0
+ for (var i = 0; i < iovcnt; i++) {
+ var ptr = HEAP32[(iov + i * 8) >> 2]
+ var len = HEAP32[(iov + (i * 8 + 4)) >> 2]
+ for (var j = 0; j < len; j++) {
+ SYSCALLS.printChar(fd, HEAPU8[ptr + j])
+ }
+ num += len
+ }
+ HEAP32[pnum >> 2] = num
+ return 0
+ }
+ function _getTempRet0() {
+ return getTempRet0()
+ }
+ function _setTempRet0(val) {
+ setTempRet0(val)
+ }
+ embind_init_charCodes()
+ BindingError = Module['BindingError'] = extendError(Error, 'BindingError')
+ InternalError = Module['InternalError'] = extendError(
+ Error,
+ 'InternalError'
+ )
+ init_emval()
+ UnboundTypeError = Module['UnboundTypeError'] = extendError(
+ Error,
+ 'UnboundTypeError'
+ )
+ var asmLibraryArg = {
+ j: ___cxa_thread_atexit,
+ v: __embind_register_bigint,
+ r: __embind_register_bool,
+ B: __embind_register_emval,
+ q: __embind_register_float,
+ t: __embind_register_function,
+ e: __embind_register_integer,
+ d: __embind_register_memory_view,
+ m: __embind_register_std_string,
+ l: __embind_register_std_wstring,
+ s: __embind_register_void,
+ h: __emval_decref,
+ i: __emval_get_global,
+ n: __emval_incref,
+ o: __emval_new,
+ a: _abort,
+ g: _emscripten_longjmp,
+ y: _emscripten_memcpy_big,
+ k: _emscripten_resize_heap,
+ A: _fd_close,
+ u: _fd_seek,
+ z: _fd_write,
+ b: _getTempRet0,
+ f: invoke_iii,
+ w: invoke_iiiii,
+ p: invoke_viiii,
+ x: invoke_viiiiiii,
+ c: _setTempRet0,
+ }
+ var asm = createWasm()
+ var ___wasm_call_ctors = (Module['___wasm_call_ctors'] = function () {
+ return (___wasm_call_ctors = Module['___wasm_call_ctors'] =
+ Module['asm']['D']).apply(null, arguments)
+ })
+ var _malloc = (Module['_malloc'] = function () {
+ return (_malloc = Module['_malloc'] = Module['asm']['E']).apply(
+ null,
+ arguments
+ )
+ })
+ var _free = (Module['_free'] = function () {
+ return (_free = Module['_free'] = Module['asm']['F']).apply(
+ null,
+ arguments
+ )
+ })
+ var ___getTypeName = (Module['___getTypeName'] = function () {
+ return (___getTypeName = Module['___getTypeName'] =
+ Module['asm']['G']).apply(null, arguments)
+ })
+ var ___embind_register_native_and_builtin_types = (Module[
+ '___embind_register_native_and_builtin_types'
+ ] = function () {
+ return (___embind_register_native_and_builtin_types = Module[
+ '___embind_register_native_and_builtin_types'
+ ] =
+ Module['asm']['H']).apply(null, arguments)
+ })
+ var stackSave = (Module['stackSave'] = function () {
+ return (stackSave = Module['stackSave'] = Module['asm']['I']).apply(
+ null,
+ arguments
+ )
+ })
+ var stackRestore = (Module['stackRestore'] = function () {
+ return (stackRestore = Module['stackRestore'] = Module['asm']['J']).apply(
+ null,
+ arguments
+ )
+ })
+ var _setThrew = (Module['_setThrew'] = function () {
+ return (_setThrew = Module['_setThrew'] = Module['asm']['K']).apply(
+ null,
+ arguments
+ )
+ })
+ var dynCall_iiijii = (Module['dynCall_iiijii'] = function () {
+ return (dynCall_iiijii = Module['dynCall_iiijii'] =
+ Module['asm']['M']).apply(null, arguments)
+ })
+ var dynCall_jiji = (Module['dynCall_jiji'] = function () {
+ return (dynCall_jiji = Module['dynCall_jiji'] = Module['asm']['N']).apply(
+ null,
+ arguments
+ )
+ })
+ function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
+ var sp = stackSave()
+ try {
+ wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7)
+ } catch (e) {
+ stackRestore(sp)
+ if (e !== e + 0 && e !== 'longjmp') throw e
+ _setThrew(1, 0)
+ }
+ }
+ function invoke_viiii(index, a1, a2, a3, a4) {
+ var sp = stackSave()
+ try {
+ wasmTable.get(index)(a1, a2, a3, a4)
+ } catch (e) {
+ stackRestore(sp)
+ if (e !== e + 0 && e !== 'longjmp') throw e
+ _setThrew(1, 0)
+ }
+ }
+ function invoke_iii(index, a1, a2) {
+ var sp = stackSave()
+ try {
+ return wasmTable.get(index)(a1, a2)
+ } catch (e) {
+ stackRestore(sp)
+ if (e !== e + 0 && e !== 'longjmp') throw e
+ _setThrew(1, 0)
+ }
+ }
+ function invoke_iiiii(index, a1, a2, a3, a4) {
+ var sp = stackSave()
+ try {
+ return wasmTable.get(index)(a1, a2, a3, a4)
+ } catch (e) {
+ stackRestore(sp)
+ if (e !== e + 0 && e !== 'longjmp') throw e
+ _setThrew(1, 0)
+ }
+ }
+ var calledRun
+ dependenciesFulfilled = function runCaller() {
+ if (!calledRun) run()
+ if (!calledRun) dependenciesFulfilled = runCaller
+ }
+ function run(args) {
+ args = args || arguments_
+ if (runDependencies > 0) {
+ return
+ }
+ preRun()
+ if (runDependencies > 0) {
+ return
+ }
+ function doRun() {
+ if (calledRun) return
+ calledRun = true
+ Module['calledRun'] = true
+ if (ABORT) return
+ initRuntime()
+ readyPromiseResolve(Module)
+ if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']()
+ postRun()
+ }
+ if (Module['setStatus']) {
+ Module['setStatus']('Running...')
+ setTimeout(function () {
+ setTimeout(function () {
+ Module['setStatus']('')
+ }, 1)
+ doRun()
+ }, 1)
+ } else {
+ doRun()
+ }
+ }
+ Module['run'] = run
+ if (Module['preInit']) {
+ if (typeof Module['preInit'] == 'function')
+ Module['preInit'] = [Module['preInit']]
+ while (Module['preInit'].length > 0) {
+ Module['preInit'].pop()()
+ }
+ }
+ run()
+
+ return Module.ready
+ }
+})()
+export default Module
diff --git a/packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.wasm b/packages/integrations/image/src/vendor/squoosh/avif/avif_node_dec.wasm
new file mode 100644
index 0000000000000000000000000000000000000000..1cd4e1b034e1e2baa6f7d9b8730216d4215a0538
GIT binary patch
literal 1364059
zcmeFa3792SmG2v|V>nZu%#$@Hl||J)0cc@EqupBAV7C?3P*n^LZTIuL@4ollhu6NZ
z@5@YEtH`SBd(xGOAmY%9iZ&`LDhevtsNjfNDk`nCqN3uAGY)Oz(26qD`~BCBIOk+l
z7KKXR`|kI>f;_P!Vh?Mty{5hP+B>2ro&A(JilX@Py?$_nujdWS?wyX74Hmh233=pHuhS@QFKKtVwH95#$C!({)>ZGoMeD6ZM_bkWn!dauhaoZcs8nQ1bO_l+yr0MwH
zz0p}K4=i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