wasm-vips 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -9
- package/lib/vips-es6.js +231 -236
- package/lib/vips-heif.wasm +0 -0
- package/lib/vips-jxl.wasm +0 -0
- package/lib/vips-node.js +234 -236
- package/lib/vips-node.mjs +235 -237
- package/lib/vips-resvg.wasm +0 -0
- package/lib/vips.d.ts +256 -244
- package/lib/vips.js +231 -236
- package/lib/vips.wasm +0 -0
- package/package.json +10 -6
- package/versions.json +11 -11
- package/lib/vips-es6.worker.mjs +0 -1
- package/lib/vips-node.worker.js +0 -1
- package/lib/vips-node.worker.mjs +0 -1
- package/lib/vips.worker.js +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# wasm-vips
|
|
2
2
|
|
|
3
|
-
[libvips](https://libvips.
|
|
4
|
-
|
|
3
|
+
[libvips](https://www.libvips.org/) for the browser and Node.js, compiled
|
|
4
|
+
to WebAssembly with Emscripten.
|
|
5
5
|
|
|
6
6
|
Programs that use wasm-vips don't manipulate images directly, instead
|
|
7
7
|
they create pipelines of image processing operations building on a source
|
|
@@ -16,7 +16,7 @@ https://github.com/kleisauke/wasm-vips/issues/1).
|
|
|
16
16
|
|
|
17
17
|
## Engine support
|
|
18
18
|
|
|
19
|
-
An engine that [supports WebAssembly SIMD](https://webassembly.org/
|
|
19
|
+
An engine that [supports WebAssembly SIMD](https://webassembly.org/features/).
|
|
20
20
|
This is present on most major browser engines.
|
|
21
21
|
|
|
22
22
|
For V8-based engines, at least version 9.1.54 is required to match the final
|
|
@@ -30,7 +30,7 @@ at least version 615.1.17 is required. This corresponds to Safari 16.4.
|
|
|
30
30
|
|
|
31
31
|
| <br>Chrome | <br>Firefox | <br>Safari | <br>Edge | <br>Node.js | <br>Deno |
|
|
32
32
|
|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
33
|
-
| :heavy_check_mark:<br>[version 91+](https://
|
|
33
|
+
| :heavy_check_mark:<br>[version 91+](https://chromestatus.com/feature/6533147810332672) | :heavy_check_mark:<br>[version 89+](https://bugzilla.mozilla.org/show_bug.cgi?id=1695585) | :heavy_check_mark:<br>[version 16.4+](https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#javascript-and-webassembly) | :heavy_check_mark:<br>[version 91+](https://chromestatus.com/feature/6533147810332672) | :heavy_check_mark:<br>[version 16.4+](https://github.com/nodejs/node/pull/38273) | :heavy_check_mark:<br>[version 1.9+](https://github.com/denoland/deno/pull/10152) |
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
@@ -48,14 +48,13 @@ yarn add wasm-vips
|
|
|
48
48
|
|
|
49
49
|
### Browser
|
|
50
50
|
|
|
51
|
-
Requires `vips.js
|
|
52
|
-
the same directory.
|
|
53
|
-
to also serve the `vips-es6.js` and `vips-es6.worker.js` files.
|
|
51
|
+
Requires `vips.js` (or `vips-es6.js`) and `vips.wasm` to be served from
|
|
52
|
+
the same directory.
|
|
54
53
|
|
|
55
54
|
Since wasm-vips requires [the `SharedArrayBuffer` API](
|
|
56
55
|
https://caniuse.com/sharedarraybuffer), the website needs to opt-in to
|
|
57
56
|
a cross-origin isolated state, by serving the following HTTP headers on
|
|
58
|
-
both the main document and
|
|
57
|
+
both the main document and `vips*.js` script:
|
|
59
58
|
|
|
60
59
|
```http
|
|
61
60
|
Cross-Origin-Embedder-Policy: require-corp
|
|
@@ -128,7 +127,7 @@ let im = vips.Image.newFromFile('owl.jpg');
|
|
|
128
127
|
// Put im at position (100, 100) in a 3000 x 3000 pixel image,
|
|
129
128
|
// make the other pixels in the image by mirroring im up / down /
|
|
130
129
|
// left / right, see
|
|
131
|
-
// https://libvips.
|
|
130
|
+
// https://www.libvips.org/API/current/libvips-conversion.html#vips-embed
|
|
132
131
|
im = im.embed(100, 100, 3000, 3000, {
|
|
133
132
|
extend: 'mirror'
|
|
134
133
|
});
|