asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!
https://kroki.io/
MIT License
146 stars 47 forks source link

Infer the width and height from the generated image #387

Open ggrossetie opened 1 year ago

ggrossetie commented 1 year ago

It would nice to infer the width and height from the generated image when width and height are not explicitly defined. For reference, Asciidoctor Diagram does the following:

PNG https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/util/png.rb#L9-L22

GIF https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/util/gif.rb#L10-L18

SVG https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/util/svg.rb#L7-L24

Originally posted by @Mogztter in https://github.com/Mogztter/asciidoctor-kroki/issues/99#issuecomment-646970963

nekator commented 1 year ago

Encountered this difference between asciidoctor-kroki and asciidoctor-diagram today as i replaced asciidoctor-diagram with asciidoctor-kroki. Missing width and height resulted in failing tests. https://github.com/confluence-publisher/confluence-publisher/commit/650036966ef04fc7210ed9b9686e7f1a0c7c47db#diff-46f69509d7d0c7f3b137dc0c21c7c8a787aba4a30ba7c527efa63173f1a9e8bcR1273