Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plantuml.com's images (/png/ or /img/) won't insert in Google Docs anymore #254

Closed
fuhrmanator opened this issue Jan 24, 2023 · 7 comments
Closed

Comments

@fuhrmanator
Copy link

I'm the dev for plantuml-gizmo and users opened an issue yesterday about images not being inserted: fuhrmanator/plantuml-gizmo#2

I tested this further and found that inserting any images into Google Docs (even by hand) that come from a PlantUML.com URL, e.g., https://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80 result in invalid images.

Debugging further, in Chrome if I open https://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80 and try to save it to disk, it suggests it's a .webp format and won't let me save it as a PNG. Perhaps this has always been like that, but it's strange.

Has something changed in the format of the images on PlantUML.com?

@arnaudroques
Copy link
Contributor

arnaudroques commented Jan 24, 2023

Has something changed in the format of the images on PlantUML.com?

Hi, no change on our side: those images are still PNG images.
This is really weird.

@fuhrmanator
Copy link
Author

Debugging further, in Chrome if I open https://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80 and try to save it to disk, it suggests it's a .webp format and won't let me save it as a PNG. Perhaps this has always been like that, but it's strange.

@arnaudroques can you explain why that happens (why it's not a .png format)? I also tried in Firefox. I don't have another (local) server to try with, to see if it does the same.

@fuhrmanator
Copy link
Author

I dumped the blob info received inside the add-on (running on Google's server), and I see the following:

bytes = '82,73,70,70,100,6,0,0,87,69,66,80,86,80,56,32,88,6,0,0,-48,36,0,-99,1,42,112,0,119,0,62,-99,66,-101,72,-91,-93,-94,-95,37,-44,-33,72,-80,19,-119,103,0,-47,16,-88,47,28,127,51,-19,107,-4,7,68,-25,-80,95,-109,-39,113,-14,126,86,-1,-94,-21,-68,-54,23,-8,-3,-17,-112,1,-8,-65,-12,-49,-12,31,-45,-4,74,-1,121,-12,3,-22,79,-8,-33,68,63,-12,60,114,94,25,-20,1,-4,-85,-7,-33,-6,111,-18,31,-115,-97,75,63,-62,127,-48,-1,31,-25,103,-25,-33,-4,-65,-34,62,1,-1,-106,127,80,-1,-95,-3,-17,-77,-17,-19,87,-78,7,-21,111,-1,-12,37,-84,96,104,108,-122,-106,-114,113,-66,30,95,-24,-64,-45,66,-64,-76,34,-34,-27,-20,64,11,-116,10,66,-20,83,80,-30,109,111,-89,109,7,-60,41,57,67,-89,58,107,-35,16,21,14,-20,-121,96,75,74,116,74,16,65,-106,83,21,39,103,-83,81,9,44,67,24,-84,84,-92,-111,-84,127,-40,14,-125,54,-128,-117,-12,86,79,13,-112,32,-98,-20,77,-81,-14,-24,34,-67,52,-94,122,57,56,-118,-27,-49,-25,-20,-28,-75,117,95,-91,-72,79,-23,-108,29,110,-64,68,103,30,-35,108,-75,-22,56,-123,-60,-95,-15,112,-34,126,-56,-102,-54,-28,-27,-6,-27,-6,84,59,-37,92,-51,36,60,47,44,117,30,30,-29,-94,-49,59,53,23,-126,-14,93,66,-74,22,-81,-97,96,99,-127,-23,32,-12,-105,-76,0,0,-2,-41,-17,125,86,114,18,55,6,115,-24,-121,-56,-63,-21,112,85,47,-69,-118,-110,98,4,-125,43,-68,15,-99,90,-24,-58,-23,-119,10,-53,119,-43,-72,121,38,-50,-9,-86,82,-87,22,40,116,124,10,26,83,-32,47,-100,-36,104,31,-74,38,-10,-57,-83,-46,-32,-4,-128,39,99,-40,124,-42,-72,-98,-28,121,110,-25,-27,-5,55,60,61,-23,13,-91,-120,-68,-85,-36,96,73,67,-124,-81,-39,-121,7,39,-101,65,-11,-62,-5,96,-112,-120,118,-111,35,-120,-112,99,-12,25,-15,-49,80,-122,-103,-66,-43,-101,-116,89,-57,-16,-112,-22,92,70,69,-42,-93,12,-29,-43,-22,126,-74,1,-9,8,-20,-80,-33,103,-63,-17,120,69,-65,53,-26,-94,73,-25,11,-94,62,-88,-123,-52,23,-44,17,-58,-18,13,95,-3,97,63,100,127,-43,-21,-11,74,81,-98,-52,119,-85,-44,50,-36,117,-49,104,105,-101,110,-18,-77,97,-21,80,-99,127,36,75,-100,-122,-103,73,-77,-84,-85,120,-3,-121,70,-64,-55,22,-70,-84,-66,-75,-87,2,-5,37,98,31,-1,104,63,-83,8,-65,-109,52,1,37,-21,-120,-8,68,54,56,122,-10,-92,-55,93,-84,87,-43,68,-55,15,43,-12,59,52,75,12,71,-5,-23,-56,63,-57,90,117,-85,74,82,-30,54,-114,-21,45,-40,-75,22,-28,59,-64,102,59,30,127,-97,8,-111,-41,-73,35,113,37,13,-111,-80,-87,22,-49,-28,11,-84,59,26,80,106,-18,94,64,-64,68,47,68,-84,59,-2,19,-24,47,32,9,110,-27,18,92,-92,97,2,111,-44,79,-11,5,-41,-42,-83,90,19,-11,38,-46,-14,-100,2,-4,15,-42,95,-95,76,104,96,79,-26,72,1,-78,-59,102,-113,-36,-27,-24,-72,37,18,26,-27,-3,-22,107,-48,-30,8,71,-4,23,76,-72,7,-25,-65,77,45,-75,49,81,-83,-117,-97,75,-34,-47,43,-10,-94,123,-75,-116,117,124,64,-112,-16,31,67,-86,-40,-96,-117,4,-87,124,126,58,41,-96,69,112,70,-71,59,9,-81,36,-53,7,23,84,62,72,-125,-3,-110,68,-23,16,95,36,-120,-112,-60,-56,-75,61,-10,-34,-11,-79,24,43,-29,98,-104,90,-44,-87,101,31,58,-108,-59,-4,-102,-120,-61,-61,31,-30,77,-9,-37,87,-105,-4,-33,-127,-6,-100,-83,-102,40,-27,-60,-100,-98,38,102,49,61,126,-93,15,-93,27,65,-28,-39,-73,-90,-108,-27,97,76,-108,5,64,-127,102,98,-57,58,18,42,91,-7,53,17,-121,-122,35,-90,31,-56,-11,-85,-61,-97,34,-29,-86,-91,-34,-31,-99,126,16,93,-8,-41,60,-81,29,9,-72,-2,-95,64,-127,-54,11,63,71,-82,-24,18,46,8,59,-37,-59,73,10,-113,-101,80,-102,127,75,87,0,-4,78,-98,28,25,-41,114,-68,7,-89,97,-34,69,-3,-128,-21,-39,52,127,50,-41,6,79,-87,-100,-14,13,-49,-98,-85,-22,84,-128,123,-29,-75,-115,-2,24,-12,-10,-1,46,-26,45,42,-117,60,3,30,9,-42,-103,42,18,39,66,49,-107,27,-59,124,-66,-89,-98,-109,-38,-27,15,61,71,-60,70,-103,-15,-39,-29,-29,70,118,-100,122,-18,120,-104,-16,110,-72,95,126,-37,64,31,22,-44,-21,102,127,100,82,106,-73,63,-108,40,127,0,62,11,29,97,118,-70,-77,-63,-114,-76,-8,-17,-44,-52,31,-29,-103,111,-12,-76,-52,48,79,-68,-99,-103,74,6,3,-53,15,10,-62,93,70,57,117,-104,85,-40,-106,45,78,20,-41,37,90,76,124,-105,-19,-12,74,17,-11,-111,-8,4,35,-80,125,-23,3,32,-8,-117,17,-79,-83,-127,33,54,119,-105,102,0,-111,114,-39,47,36,85,-85,-27,60,-72,-79,-53,-50,96,-106,-46,-77,-9,103,50,108,-19,-29,1,41,-57,96,-127,71,121,-1,55,-1,50,103,-43,-39,119,-47,-105,88,116,-56,-108,120,-107,-74,-2,-61,-6,7,-77,123,-72,60,8,-56,-127,-7,63,70,-114,-125,-111,25,69,102,-46,92,-49,-36,115,-68,79,25,94,-121,-58,72,-123,-97,-113,95,38,-41,-56,-118,-27,74,90,103,-109,4,-93,-91,-66,34,-60,108,107,94,36,-62,73,-60,-109,56,113,-88,86,64,-87,-12,-91,62,87,-106,-119,-37,56,42,43,-103,76,73,64,-119,9,-121,-7,42,124,-110,-87,41,116,-69,-87,-112,-121,-47,21,-26,-23,5,-103,-79,-26,114,82,-65,-112,-72,-77,-48,54,-89,71,-127,109,98,33,-99,10,33,-62,-92,-69,104,-77,67,87,-96,-48,-106,-67,84,13,102,123,-127,67,-53,-20,-26,-77,2,-54,-104,45,127,61,115,-110,7,-81,-4,-15,6,97,82,27,-52,-65,100,34,-63,5,-115,-1,-95,-40,18,77,68,60,-17,13,48,-1,25,-53,86,-97,116,-124,43,106,-25,93,53,30,36,-126,5,-118,100,93,63,32,-6,82,-83,-40,118,-10,-117,-86,-31,-33,-57,-60,-95,98,-35,23,-100,85,44,-97,98,101,-67,106,-24,-82,-28,0,85,-13,-69,-80,-51,-74,-41,5,-73,43,32,120,97,-8,53,-124,40,91,34,-38,-95,-89,53,89,-77,25,-38,-99,-122,-86,69,70,-68,-38,114,-106,122,-27,-17,-116,111,-120,-73,42,125,78,49,4,-67,104,43,104,34,11,-53,92,-55,93,84,87,46,-29,-1,-86,28,-8,38,-36,39,15,-31,99,27,68,-35,-10,-3,44,54,104,12,58,-73,57,-99,63,-30,-7,-49,-77,25,94,-25,-20,103,-77,8,24,-72,-91,94,50,-32,-111,-101,109,-125,-120,-113,-80,-27,-26,29,-8,-122,-37,-82,112,-98,-2,30,-125,64,-62,-112,-74,-15,56,46,119,1,-83,50,26,-81,-111,82,83,-97,-53,15,-104,-71,-71,-106,-24,-56,52,109,-65,-48,82,39,-59,96,-48,-83,-56,124,58,-77,-63,39,-49,-4,14,-31,-15,-84,-70,-97,62,-112,-47,-79,73,-93,1,67,-53,-10,-65,78,-1,28,-62,45,-99,-54,-29,24,-56,-20,84,-93,83,-29,-120,30,50,47,50,101,0,105,-115,113,103,109,23,-18,77,-74,-14,-85,-95,-57,-7,25,-44,13,-18,-5,108,-89,20,-57,-107,-69,-109,-76,-6,101,-42,-89,-18,-124,54,22,87,16,30,-95,-21,44,-44,24,-26,-62,-74,-99,20,-59,-3,64,-86,-92,-1,30,-29,-35,-76,-51,110,-72,-46,-55,101,91,11,24,53,68,76,-42,-78,-38,-90,-93,-125,63,20,26,57,-54,-42,-37,99,88,-11,27,9,-23,69,21,0,0,0'

The first 4 bytes (82,73,70,70) are ASCII for RIFF. I'm guessing the next 4 are a length, and then I see the next 4 are 87,69,66,80 which translates in ASCII to WEBP.

Either Google allowed this before (as a PNG) and is not allowing it now, or something has changed in the encoding of the images.

My "Save as..." in Chrome of the image at https://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80 also yields a WEBP format on my computer, yields a file with the same RIFF and WEBP header (it's not a PNG). Notepad++ shows the bytes:

image

Using PlantUML on my local machine, I generate and save the same source to a PNG, and I get a true PNG (again viewed with Notepad++):

image

@fuhrmanator
Copy link
Author

Some more facts that I hope can help to get to the bottom of things:

@fuhrmanator
Copy link
Author

I asked ChatGPT 😄

image

Could it be the server started optimizing things without us realizing it?

@arnaudroques
Copy link
Contributor

Thanks for your investigation!
So we confirm that the issue is on our side: our hoster is now doing on-the-fly image optimization and is converting PNG image to WEBP automatically. We are trying to disable this behaviour.

@fuhrmanator
Copy link
Author

exifinfo.org shows the images are correct (PNG) again on the /img/ URLs of PlantUML.com.

image

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants