Posted by
oddhack on
URL: https://discuss.asciidoctor.org/Problems-imbedding-images-without-format-suffix-tp8342.html
I'm trying to do math in a document by imbedding an image generated by a remote service, such as
image:
https://render.githubusercontent.com/render/math?math=\displaystyle \text{b} = V D[]
In the HTML5 renderer, this works. In asciidoctor-pdf (using -a allow-uri-read, of course), I get a message like this:
> asciidoctor: WARNING: could not embed image: /tmp/image-20201112-19102-165jx60; image file is an unrecognised format
Capturing the returned image, it's just normal SVG. If I take that returned image and name it e.g. 'foo.svg' and feed
that into asciidoctor as an image (HTML5 or PDF), it works fine. But if I name it in the same fashion as the WARNING, e.g. 'image-20201112-19102-165jx60', and feed
that into asciidoctor as an image, I get the exact same WARNING from asciidoctor-pdf - and, although there is no warning or error message, the HTML5 renderer generates a broken-image link.
I infer that asciidoctor usually, though not always, requires an image format suffix on the source argument of image: to determine how to process it. There do not appear to be any options for the image: directive that allow specifying the format explicitly. There's no apparent reason the asciidoctor component (or external ruby gem?) fetching the image couldn't name it properly or otherwise recognize the format; the HTTP headers returned from the render server label it 'Content-Type: image/svg+xml' so that information is
available, just apparently not being used.
Any thoughts on how to proceed?
Jon