Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Sometimes Missing Response-Headers for broken PNG Images

0 votes

Basically when you request a broken PNG image then some response headers are omitted.
I have set 3 Response-Headers in the method sendDiagram() in Class DiagramResponse

This problem can be reproduced with JMeter for example.
There is no such problem for requested svg images.

I posted a more detailed description of the issue on github: https://github.com/plantuml/plantuml-server/issues/22

 

asked Mar 31, 2016 in bug by anonymous

1 Answer

0 votes
We found a fix for this issue and we are going to provide a patch to plantuml soon.

The problem is within the plantuml library in Class ``PngIOMetadata``.
The outputstream was not closed properly, which leads to the observed behaviour in JMeter..
answered Apr 1, 2016 by anonymous
Hello Arnaud,

you'll find the fix for this problem here:

https://dl.dropboxusercontent.com/u/3895504/png_os_fix.patch

Can you please integrate this into the plantuml library?

Greetings

Michael
Sorry about this and thanks for your debug session!
Your code will be integrated in next release.

https://dl.dropboxusercontent.com/u/13064071/PngIOMetadata.java

We just slightly modify it to keep synchronization on ImageWriter object. It's not clear whether or not ImageWriter are thread-safe and if they could be share/reused. And this might be JVM dependant.

So we kept synchronization, just in case. If anyone has some idea about it, do not hesitate to post.

And thanks again for your contribution and your support!
Ok thank you!

When do you plan a new release?

Just one remark about the synchronization: If the ImageWriter object is *not* thread-safe then such synchronization should also be done when writing images/PNGs *without* metadata: see PngIO#write() line 86 -> ImageIO.write(image, "png", os);

However the ImageIO.writer() Method do not synchronize the access to the ImageWriter object.

Greetings

Michael
The new release will be done today or tomorrow.
Thanks for your comment about synchronization, we'll think about it (even if we won't change anything yet in next release).
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...