IMG with DATA url (long?) fails silently

0 votes
asked Apr 19 by Fuhrmanator (2,170 points)

The following example works:

@startuml
start
:foo;
note left
 You can use images <img:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==>
end note
stop
@enduml
 
However, trying to use bigger images results in longer data URLs, and PlantUML fails (silently). There's no error, and there's no image. Here's an example:
 
@startuml
start
:foo;
note left
 You can use images <img:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAABnRSTlMAAAAAAABupgeRAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE6ElEQVRo3u2aT1ATVxzHP7uAEhSIKAwGrUI7CA1gO20Z2hNitXqwM21n2o7l3mkLh0470oM9tjNVT9Wbh3amanE6ndhTBYt/WkfkT1VGIIIGEGJAEiBASCAJ2R4gtpDd7K78SezwPe77ve/77O4v7/3e2wgsXclpmIowmcl8HuM2UrMwpJOwDiA4g2+cyWHcdpw2HO0MdjA9ucQBhafvmpZN4VsUVGAyzyNqUdCP4y73GrDWMzm8atACeWWUfkTeG4iJT3/PswFs12k+S1/zCkPnllFeTU4xy6iB21w5SX/rCkCnb2X/EfIrEASWXZKEtZ5LxzUmTIIm05JDvP892QUrQgwIApkvsPttxh04bUuGTlzPwaOUV5G4npVWUjKF+0jJoPcmUuhpoQ1GPjxFwV5WTwKmInJKuH+NoF8/9IbNVJ7GVMzqa9N2csvoaiAwrQc6xUjlabLyiZVSs9hZirVe9nknyOfxB6di84wXcWe/SGddZH7LQR/8enXzOGqeJKdiu64GXXKI8iriRzlFOHtwLZgHxYgV5CviSwIHj7JxizL0/hqSU4k3pRh580sF6Nwy8vcQnzIfYNtLkdACe6pXapVehhwR2VMdAZ1XFvs5Lrp2vMr2lxdCl1YS7xKeQIrzk0be68S/8svZkBGGLty/pD3IqikhiYJ9Yeg4Wf+0qGAvIGJIY6v5mYHetpt1KSKmYhKSnhnoJAPZhYmYirR28I7RfJbuK4z2A2TsYFcFpYcxGPUNPDU67zPWDwKbd7KrgtcOY0jX1N1kFnjnGOYD6qF9zViOMDW6+PrGLbx7nOde0UrcexNLDd6xCJ9M3jvxZCaOprYLIpty1OPsbZyvkiEGPC5qP8PRrvW04Hy1DDHgcVL7KYNWdRNjjsjGLJWggA9LjdLOB8DvxVJDcFrFxz+FpYbgjGLAzBQXogbMKS1bxJCmEtT4I+MOlZixAZrOqMTc+IGJIZWYkT5azqkVfRmiytmA30vLz5peffOZaA97xkNrrSafpp+i7MPnThpEFYvuK/jcWueE7j8VW7samJ7Q5ONx8eCv6CGiSg5ZL+mYy+4pB1v/WB4fIDgtRnsAs359R5p9TYSCcsP4ediiw6dXwSf8SkUmnYrNzgfMeHQM5nXj6pW5PtyF36tn9RmZX79kNTEk4rYrNg/e073MDsl10TL7avGZk/uRGO2U0mXTPZhsF1fP8vjMv3+biKND+Z7sugcbsy+TzyPFJke7iOMuswGF7NH/TUT2VHzisX4fhS6BaYasIr5xBjsUyzq98kbWJxJet34fhaHtd/B7RYCuy3Ltkr6p48nKt9hGwj+l30fhs13X5fB2q7OO0GwkMwGf7sH8EV2kkHoNJOMjVxHMBrDWh6HHB+lplAmKvBNVRS4KEtFWCu0+wP1rc+Wx+G+5I5MgId2DSZJMmslcVPUJyfiEIcPQPY1aC/lY6eHf9N9aCI3E1ZMgxSmxNIfHImjoaaT7apxCd15k4LYcNFD3neJcE0P53Fw6sbCe/q/GHdQfi7fM4Pdv8DiVoYG237hjiSPm1lo66yJ2LpG6+C0Dt+KCuPfmosRQhg7O8MvnOO/HmHiok1+/kC3mRMV65dzHsSSeDXDuE6U/Dinvxj0jMf35haLUmCLPoNag16DXoP+P0BITjwn4kEKEQgR8ivvqJegfpQrRyPCHUQ0AAAAASUVORK5CYII=>
end note
stop
@enduml 
 
The Image URL is ok:  
 
It fails silently with the PlantUML.com server AND with the .jar file in Windows. No image is produce and no error either.
commented Apr 19 by Fuhrmanator (2,170 points)
Note: the image I put in the question WAS ok when I used the editor, but on my Chrome it won't display because of a security error. I was able to right-click the image and "Open in new tab" and then remove the "denied:" part of the URL that I believe Chrome inserted. Other browsers may be OK. In any case, I'm certain the data: URL is valid.
commented Apr 19 by plantuml (131,770 points)
This one is not easy to solve: PlantUML have issues with very long lines (this is due to the massive use of Regular Expression).
We have to think about it...
commented Apr 20 by Fuhrmanator (2,170 points)
I have scrapped RegEx use in one of my projects that was just too hard to maintain. I replaced it with PEG. I hacked this in about 10 minutes; maybe it's a way that could work for PlantUML in the future? There are PEG classes for Java, too. This one is javascript-based: http://peg.arcanis.fr/25ggh6/ It might not be fast enough for general use in PlantUML, but you could perhaps try it in some places?
commented Apr 20 by plantuml (131,770 points)
The issue was on our server.
Should be fixed now.
For example: http://www.plantuml.com/plantuml/uml/VLQthYs73UpVLxp-6DYS9CFGvfppwJRddFVhVQNAbGaG78Q6u02SlxOzMVTZw7_z0txzKKxJdx_6QIz-zqMv_ugdutUMZB-FhVZT34bLRB__tGpL7tco9t_yKm3ciVepJRO2H__L18pfNA0gLXFzOuRhrxnV_I1D_pkdM5h-2SpywkJV1JdgUjuE79GkeBmEzDQxLsEa6gQAPJw7TWGnqbn9Yp0yY-qWzgvCy_X2YUiWJfgr0y_POCejOy9r8oFd570rIFpBojHA06UPfwlEsFxKyRSD_ey_lCE8s3Qq1R2cmqVNFWzMrEbFGz0jLnlJ8J0nOgfFh2kUI5loSmt8szOD0KZ5tensANI0TkqTGWmDataH_h61dEYn9EfhBzIWXapDCC7sbMJiaWhJrcF6UntMrMJGjukFL_oiSu6Wp07BmcZ2z2iV-62JBIf8vGu7afdDMG70STmJX_8D1nbrTW8QkxAzJrRKa8o8KYIYUrC4UmcL5AHBJqv0uQPq2YHztnx2eQFWAI_QGpn1HJIFuq9YNX8L47xNOitE31J3-pRSZc_cMhajPSXuWk6fuOig0G5bzvpMV4MB0YbOUA80D5IKAuPqmGsxDt4OM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1PLVP6VaqR7AhD3jUi6sQjmQtFXozIyijJ3EKxalBSXnuGELfOYMUom7nyy1_oT7IgeyozzriVKCIJv44XNVQH3ZOFLEq5UB7IDHjONPT4EJnoYNQ6gxEjHcVyLEGbyaDMEfE1Vrgz_UG6dxNwr8Iv8LblhRMD3yqQb8Ef2s7R1EiVFGVRAPve_TncDjMqnD9NFun3ReQqKU8hWIe_gShMm__tbXGVqT_UXBVKQVXRIDDy_qCWzx07bltFhsBCV_-js7ya_3J_-kid_T7pl_yB

Note that there is a limit about 4kb for URL size
commented Apr 24 by Fuhrmanator (2,170 points)
Seems to work now -- not sure why I was having trouble with the .jar (running locally). Thanks for following up!

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...