Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to display PlantUML generated PNG files (reason below)

Mark Morga January 10, 2022

I am seeing a repeatable issue. When first inserting a PNG file generated by PlantUML into a confluence page, it appears to display the image correctly. After publishing the page, the image still appears correctly, but after refreshing/reloading the page, a gray box is shown with the message "Preview unavailable". 

After trying a number of different things with PNG files, the issue is related to either a `tEXT` or `iTXt` chunk in the PNG file. PlantUML inserts a `tEXt` chunk in the PNG file with the string: "keyword: copyleft Generated by http://plantuml.com"

 And the `iTXt` chunk contains the PlantUML source for the generated diagram.

If you remove these chunks by adding the command line option `-nometadata` to plantuml, the resulting PNG does not contain these chunks and Confluence seems to display it correctly.

1 answer

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2022

Hi @Mark Morga

Welcome to the community!

Are you using a 3rd party plugin for this macro or are you inserting the pngs?

This post may be able to help you: https://community.atlassian.com/t5/Confluence-questions/plantuml-app-diagram-always-shows-broken-icon-on-page/qaq-p/1432529

Regards

Mark Morga January 12, 2022

I'm not using a plugin. It occurs with either using the API to upload the image or when using the insert file or image when using the web editor. The issue is directly related to Confluence's inability to handle the `iTXt` chunk in the PNG format. I have a workaround which is to generate the PNG without the metadata added (which is stored in that `iTXt` chunk).

It is a bug in PNG handling in Confluence which should be addressed, but I posted the message to provide a workaround solution for any other users that may run into the same problem I did - to save some time. Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events