heic-to 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/heic-to.js +8 -9
- package/dist/heic-to.min.js +1 -1
- package/package.json +1 -1
- package/src/index.js +10 -11
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ This will open `http://127.0.0.1:8080/example/` for easy testing.
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
brew install cmake make pkg-config x265 libde265 libjpeg libtool
|
|
55
|
-
brew
|
|
55
|
+
brew install emscripten
|
|
56
56
|
|
|
57
57
|
git clone git@github.com:strukturag/libheif.git
|
|
58
58
|
```
|
package/dist/heic-to.js
CHANGED
|
@@ -46,17 +46,16 @@ var decodeBuffer = (buffer) => __async(void 0, null, function* () {
|
|
|
46
46
|
const id = (Math.random() * (/* @__PURE__ */ new Date()).getTime()).toString();
|
|
47
47
|
const message = { id, buffer };
|
|
48
48
|
worker.postMessage(message);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
return reject(message2.data.error);
|
|
55
|
-
}
|
|
56
|
-
return resolve(message2.data.imageData);
|
|
49
|
+
const handleEvent = (event) => {
|
|
50
|
+
if (event.data.id === id) {
|
|
51
|
+
event.currentTarget.removeEventListener("message", handleEvent);
|
|
52
|
+
if (event.data.error) {
|
|
53
|
+
return reject(event.data.error);
|
|
57
54
|
}
|
|
55
|
+
return resolve(event.data.imageData);
|
|
58
56
|
}
|
|
59
|
-
|
|
57
|
+
};
|
|
58
|
+
worker.addEventListener("message", handleEvent);
|
|
60
59
|
});
|
|
61
60
|
});
|
|
62
61
|
var encodeByCanvas = (imageBuffer) => __async(void 0, null, function* () {
|