poppygl 0.0.3 → 0.0.4
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/dist/index.js +5 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -742,7 +742,7 @@ function createSceneFromGLTF(gltf, resources) {
|
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
// lib/gltf/resourceUtils.ts
|
|
745
|
-
import { PassThrough } from "stream";
|
|
745
|
+
import { PassThrough } from "readable-stream";
|
|
746
746
|
import * as PImage from "pureimage";
|
|
747
747
|
function bufferFromDataURI(uri) {
|
|
748
748
|
const match = uri.match(/^data:.*?;base64,(.*)$/);
|
|
@@ -773,7 +773,9 @@ async function decodeImageFromBuffer(buf, mimeType) {
|
|
|
773
773
|
return PImage.decodePNGFromStream(bufferToStream(buf));
|
|
774
774
|
if (type === "image/jpeg" || type === "image/jpg")
|
|
775
775
|
return PImage.decodeJPEGFromStream(bufferToStream(buf));
|
|
776
|
-
throw new Error(
|
|
776
|
+
throw new Error(
|
|
777
|
+
`Unsupported embedded image mimeType: ${mimeType ?? "unknown"}`
|
|
778
|
+
);
|
|
777
779
|
}
|
|
778
780
|
|
|
779
781
|
// lib/gltf/parseGLB.ts
|
|
@@ -924,7 +926,7 @@ import * as PImage2 from "pureimage";
|
|
|
924
926
|
var pureImageFactory = (width, height) => PImage2.make(width, height);
|
|
925
927
|
|
|
926
928
|
// lib/image/encodePNGToBuffer.ts
|
|
927
|
-
import { PassThrough as PassThrough2 } from "stream";
|
|
929
|
+
import { PassThrough as PassThrough2 } from "readable-stream";
|
|
928
930
|
import * as PImage3 from "pureimage";
|
|
929
931
|
async function encodePNGToBuffer(image) {
|
|
930
932
|
const passThrough = new PassThrough2();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poppygl",
|
|
3
3
|
"main": "dist/index.js",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/tscircuit/poppygl.git"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"gl-matrix": "^3.4.4",
|
|
37
|
-
"pureimage": "^0.4.18"
|
|
37
|
+
"pureimage": "^0.4.18",
|
|
38
|
+
"readable-stream": "^4.7.0"
|
|
38
39
|
}
|
|
39
40
|
}
|