create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
67 stars 15 forks source link

TypeError while attempting to load a specific 3D Image from a base64 #140

Closed Cereser01 closed 1 year ago

Cereser01 commented 1 year ago

Hello, I am experiencing errors while attempting to load a specific base64 3D Image through the following construction:

< x3d-canvas id="3dgraphicimg" src="data:model/+vrml;base64,I1ZSTUwgVjIuMC[...]Qp9DQo=" class="" > < /x3d-canvas >

(full content of the src attribute available in attached "error_src.txt" file) error_src.txt

The following errors pop up in console:

image

x_ite.min.js?v=6.6.0.322:1  Couldn't load URL 'https://local.weg.net:9002/catalog/weg/BR/pt/Motores-Elétricos/Trifásico---Baixa- 
Tensão/Uso-Geral/W22/W22-/W22-IR3-Premium-0-16-cv-2P-63-3F-220-380-V-60-Hz-IC411---TFVE---B34D/p/12218559'. 
TypeError: 
First argument to DataView constructor must be an ArrayBuffer
at new DataView (<anonymous>)
at Uo.setInput (x_ite.min.js?v=6.6.0.322:1:442174)
at ha.parseIntoScene (x_ite.min.js?v=6.6.0.322:1:479156)
at sh.createX3DFromString (x_ite.min.js?v=6.6.0.322:1:606814)
at sh.createX3DFromURLAsync (x_ite.min.js?v=6.6.0.322:1:607372)
at sh.loadDocumentAsync (x_ite.min.js?v=6.6.0.322:1:607914)
at sh.loadDocument (x_ite.min.js?v=6.6.0.322:1:607572)
at sh.createX3DFromURL (x_ite.min.js?v=6.6.0.322:1:607266)
at x_ite.min.js?v=6.6.0.322:1:1347582
at new Promise (<anonymous>)

x_ite.min.js?v=6.6.0.322:1  Error: Loading of X3D file aborted.
at s.createX3DFromURL.s.ready (x_ite.min.js?v=6.6.0.322:1:1347623)
at sh.createX3DFromURLAsync (x_ite.min.js?v=6.6.0.322:1:607359)
at sh.loadDocumentError (x_ite.min.js?v=6.6.0.322:1:608946)
at ha.parseIntoScene (x_ite.min.js?v=6.6.0.322:1:479310)
at sh.createX3DFromString (x_ite.min.js?v=6.6.0.322:1:606814)
at sh.createX3DFromURLAsync (x_ite.min.js?v=6.6.0.322:1:607372)
at sh.loadDocumentAsync (x_ite.min.js?v=6.6.0.322:1:607914)
at sh.loadDocument (x_ite.min.js?v=6.6.0.322:1:607572)
at sh.createX3DFromURL (x_ite.min.js?v=6.6.0.322:1:607266)
at x_ite.min.js?v=6.6.0.322:1:1347582

Notably, other 3D Images loaded through the same method work just fine. See "work_just_fine_src.txt" for the content of the src attribute of an image that does not generate the error. Additionally, both images generate without issues in a separate application that does not rely on the base64 method. work_just_fine_src.txt

create3000 commented 1 year ago

As it turns out your file contains a BOM (https://en.wikipedia.org/wiki/Byte_order_mark), which was not properly handled by X_ITE, but this is fixed now.

Version 8.11.7 is just released.

Cereser01 commented 1 year ago

It did indeed solve the problem. Thank you so much for the quick assistance.