Comments (13)
PlantUML Gizmo uses a (legacy?) url with
/img/
Ok, we've just fix it.
Is it working better? Thx!
from plantuml-gizmo.
Thanks everyone for their patience. I'm stuck trying to debug this (I can't find the logs for my Logger.log
debug output with the latest Google Cloud jungle). I created a question here: https://stackoverflow.com/questions/75226575/how-to-view-logs-in-a-test-deployment
from plantuml-gizmo.
I'm really sorry about all this: our host is still working on rolling back to PNG...
I'm not sure why it is taking so long
from plantuml-gizmo.
PlantUML Gizmo is now inserting images again (at least for me). Thanks for your help, @arnaudroques.
from plantuml-gizmo.
I just started getting this on all diagram-insert button presses too. Linux / Firefox. The sidebar preview updates/shows without issue.
from plantuml-gizmo.
I'll try to look at this! I suspect it's a change at plantuml.com web service (I haven't modified the code at Google in more than a year).
from plantuml-gizmo.
Ok, I've made some progress - it's something related to PlantUML images.
Try a test in Google Docs: Insert > Image > By URL. In the dialog for the URL, paste https://www.plantuml.com/plantuml/img/SyfFqhLppCbCJbMmKiX8pSd91m00
(it's the default image). It displays properly.
However, when I click Insert, the result in the Google Docs is bad:
from plantuml-gizmo.
I opened plantuml/plantuml-server#254 and referred to this issue.
from plantuml-gizmo.
Ok, I've made some progress - it's something related to PlantUML images.
Maybe a security issue on Google Docs side?
Those images are regular PNG images. Or maybe it's because the URL does not end with .png
?
Keep us informed!
from plantuml-gizmo.
Arnaud Roques confirmed it's a problem on PlantUML.com, which recently began serving WEBP instead of true PNG images. My logs for the add-on in Google's cloud show the problem started last Sunday. WEBP images are compatible with most modern browsers, but sadly not compatible with Google Docs (it's an unsupported format for images). That is why the preview works OK (it's an image rendered by the browser).
I tried to find a way to convert them (server side) and it's not something simple. The Google Apps Script back-end is Rhino-like javascript and there's no easy way to use npm or other common libraries. In a browser, it's very easy with an HTML canvas to convert WEBP to PNG.
If anyone has ideas, please don't hesitate to share here!
So, unfortunately PlantUML Gizmo will be unusable until PlantUML.com's hosting service can be set to serve PNGs again.
from plantuml-gizmo.
Following the problem of server-side conversion of WEBP to PNG, ChatGPT gave me the following suggestion using Jimp:
const Jimp = require('jimp');
function convertWebpToPng(blob) {
return new Promise((resolve, reject) => {
Jimp.read(blob, (err, image) => {
if (err) {
reject(err);
} else {
image.getBuffer(Jimp.MIME_PNG, (err, buffer) => {
if (err) {
reject(err);
} else {
resolve(buffer);
}
});
}
});
});
}
But to use npm in an add-on, I believe it would be necessary to convert the whole project to Cloud Run (which is not trivial): https://codelabs.developers.google.com/codelabs/workspace-add-on-nodejs-cloudrun
from plantuml-gizmo.
Ok, we've set up a temporary workaround which should just work.
Can you try and tell us?
Thanks!
from plantuml-gizmo.
Thanks for letting us know what's happening.
PlantUML Gizmo uses a (legacy?) url with /img/
such as this and it to just re-direct to PlantUML's main page (invalid url?). So it's not a good workaround - it's the same result when you try to insert an image.
However, it appears that specifying a url with /png/
such as https://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBCoKnELT2rKt3AJx9IS2mjoKZDAybCJYp9pCzJ24ejB4qjBk42oYde0jM05MDHLLoGdrUSoeLkM5u-K5sHGY9MGw6ARNHryQb66EwGcfS2T300 then according to exifinfo.org it's a PNG file (and should work).
I can change Gizmo to use '/png/' but would rather not make a change to the (legacy) behavior if this fix is temporary. Will the /img/
URLs return to PNG?
from plantuml-gizmo.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plantuml-gizmo.