tplant
tplant copied to clipboard
Broken .png files.
Hi,
Today I tried to create a .png file twice and both times they came back corrupted and unable to display. File length 111.2 kB. The .svg is still working fine.
"uml": "tplant --input src/app.ts --output uml-diagram.png"
( tplant --version 2.3.0 )
This problem still exists, but now it's the same for SVG files as well. Reading the png file as UTF8 without BOM gives some more information as the file is an error page returned by the server:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /plantuml/png/[hash removed]
on this server.<br />
</p>
</body></html>
This is attempting to hit plantuml.com/plantuml/png/[hash]
. This must have started failing requests.
https://github.com/bafolts/tplant/blob/master/src/index.ts#L138
Will need a different mechanism to generate these images.
I am guessing we ended up hitting a server running.
https://www.npmjs.com/package/node-plantuml
Most likely need to update this tool to use that package when generating the image.
Still occurs in tplant version 2.3.3
Still occurs in tplant version 3.1.0, any suggestions?
Has been no fix to this. We still rely on the hosted file server. Will need an update to generate the images locally.
@lcy19 can you test #102 ? That will generate the images locally and no longer depend on the server. Anyone else in this thread can feel free to test the PR on their machine then I will merge and push new version.
@bafolts Thanks for your work. I tried in Mac mini (M1, 2020), it works for svg and puml,but png is still not work. I'm not sure the way I test whether is right. First download your code, then
npm install
npm run build
and then using index.js
in dist folder. The test files are livekit/server-sdk-js,and test commands are
node ./index.js -i server-sdk-js/src/**/*.ts -o tmp.png
The way you tested is right. If you open tmp.png does it have image of an error?
yes, using vscode to open it and error like this
BTW, when I run npm install
, it reports some error, so using npm install --force
I'm not sure whether this problem is about node version, my using node version is v16.15.1