Git Product home page Git Product logo

Comments (13)

arnaudroques avatar arnaudroques commented on June 29, 2024 2

PlantUML Gizmo uses a (legacy?) url with /img/

Ok, we've just fix it.
Is it working better? Thx!

from plantuml-gizmo.

fuhrmanator avatar fuhrmanator commented on June 29, 2024 1

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.

arnaudroques avatar arnaudroques commented on June 29, 2024 1

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.

fuhrmanator avatar fuhrmanator commented on June 29, 2024 1

PlantUML Gizmo is now inserting images again (at least for me). Thanks for your help, @arnaudroques.

from plantuml-gizmo.

awwaiid avatar awwaiid commented on June 29, 2024

I just started getting this on all diagram-insert button presses too. Linux / Firefox. The sidebar preview updates/shows without issue.

from plantuml-gizmo.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

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.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

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.

image

However, when I click Insert, the result in the Google Docs is bad:

image

from plantuml-gizmo.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

I opened plantuml/plantuml-server#254 and referred to this issue.

from plantuml-gizmo.

arnaudroques avatar arnaudroques commented on June 29, 2024

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.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

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.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

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.

arnaudroques avatar arnaudroques commented on June 29, 2024

Ok, we've set up a temporary workaround which should just work.
Can you try and tell us?
Thanks!

from plantuml-gizmo.

fuhrmanator avatar fuhrmanator commented on June 29, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.