edemaine / svgtiler

Tool for drawing diagrams on a grid, combining grids of SVGs into a big SVG figure
MIT License
61 stars 6 forks source link

Simple .ods file fails to load #108

Closed hayashi-stl closed 3 months ago

hayashi-stl commented 3 months ago

I tried to use the latest version of svgtiler with even a simple .ods tilemap and it gave this error:

$ svgtiler a.txt a.ods
* a.txt
* a.ods
TypeError: Cannot read properties of undefined (reading 'length')
    at XLSXDrawings.<anonymous> (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:2648:33)
    at XLSXDrawings.parse (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:2668:12)
    at new Input (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:1489:14)
    at new Drawings (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:2602:14)
    at new XLSXDrawings (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:2636:5)
    at Function.parseFile (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:1510:16)
    at Function.recognize (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:1521:42)
    at inputRequire (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:3912:18)
    at /home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:4296:31
    at runWithDriver (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:851:14)
    at Driver.main (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:4030:14)
    at main (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:4396:25)
    at Object.<anonymous> (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:4507:5)
    at Object.<anonymous> (/home/hayastl/.nvm/versions/node/v16.13.2/lib/node_modules/svgtiler/lib/svgtiler.js:4510:4)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

a.txt (just maps a to a square): a.txt a.ods (consists of a single a): a.ods

Note that if I export that spreadsheet as a .csv or an .xlsx instead, svgtiler works. I'm using Ubuntu 20.04 with LibreOffice 7.6.2.1 (x86_64)

edemaine commented 3 months ago

Thanks for the report! Seems to be an upstream issue, so I've raised https://git.sheetjs.com/sheetjs/sheetjs/issues/3162

We could work around it, but then we wouldn't be able to tell which sheets are hidden.

hayashi-stl commented 3 months ago

Well, as it is, the documentation is inaccurate, since it claims to support .ods

edemaine commented 3 months ago

svgtiler@3.1.8 implements a workaround so that .ods files at least work, but hidden sheets will be treated as unhidden, until the upstream issue can be addressed.