I am currently utilizing Three.js to store and retrieve objects in a database. The objects are being inserted as JSON format.
However, the issue I am facing is that when using JSON.stringify or toJSON(), it converts the image url (textures) into base64 format instead of retaining the http URL.
Here is the original JSON data:
{
"metadata": {
[...]
},
"geometries": [
{
[...]
}],
"materials": [
{
[...]
}],
"textures": [
{
[...]
}],
"images": [
{
"uuid": "4ED9CE3E-7C8A-4EB7-8CF8-D90B3527DF5F",
"url": "data:image/png;base64,iVBORw0KGgoATyuRZGZVREd0FAERRRBAEBEFwAYEyKqP/Rfozx+5fDYjvpeT/akv+n/J+/7eMjX9Ke8uojP4JVAYAyuj/Ld3Por7fPQ9i8d7vvr8LKNzLg/dn1u1hvQf3q/v92vRX0X/ [...]"
}],
"object": {
[...]
}
}
The desired output for JSON would be:
{
"metadata": {
[...]
},
"geometries": [
{
[...]
}],
"materials": [
{
[...]
}],
"textures": [
{
[...]
}],
"images": [
{
"uuid": "4ED9CE3E-7C8A-4EB7-8CF8-D90B3527DF5F",
"url": "http://www.domain.com/picture/path.png"
}],
"object": {
[...]
}
}
Is there a solution available to achieve this?