Hello!
I’ve been working on a specific project involving using a third-party API. After talking a while with @George I received a snippet of code that should help me, but unfortunately it seems like I’m missing an important library or something.
When I launch it on desktop, the console gives me an error regarding Z.DataTexture.toArrayBuffer():
Uncaught TypeError: DataTexture.toArrayBuffer is not a function
at eval (wip:28)
at zappar._device._processSnapShotToTextureCallBack (zappar.js:1)
at zappar._device._message (zappar.js:1)
at Object.zappar.msg (zappar.js:1)
at <anonymous>:1:8
at WebFrame.(/C:/Users/meneg/AppData/Local/Programs/ZapWorks-Studio/resources/app/zapparembed/data/js/anonymous function) [as executeJavaScript] (C:\Users\meneg\AppData\Local\Programs\ZapWorks-Studio\resources\electron.asar\renderer\api\web-frame.js:56:27)
at resolve (C:\Users\meneg\AppData\Local\Programs\ZapWorks-Studio\resources\electron.asar\renderer\web-frame-init.js:15)
at new Promise (<anonymous>)
at EventEmitter.ipcRenderer.on (C:\Users\meneg\AppData\Local\Programs\ZapWorks-Studio\resources\electron.asar\renderer\web-frame-init.js:14)
at EventEmitter.emit (events.js:182)
I have no idea what causes this to not work, especially because it looks like Zappar’s missing a definition for what a DataTexture is or DataTexture is missing the toArrayBuffer() function.
I also encountered issues with other parts of the same code, specifically a line assigning the image’s format before sending it to the API:
format: (<any>Z).DataTexture.ImageFormat.jpg,
saying that it doesn’t recognize “ImageFormat.jpg”
I’m thoroughly lost. All I wanted to do is take a photo and remove the photo’s background using any sort of segmentation and it seems I’ve stumbled upon an iceberg of an issue.
Please help