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

Converter cannot locate fetched diagram if image output directory does not match imagesdir #373

Open
mojavelinux opened this issue Jun 4, 2022 · 3 comments

Comments

@mojavelinux
Copy link
Member

If the image output directory does not match the value of imagesdir, such as when imagesoutdir is specified, the converter cannot locate the fetched diagram. This particularly affects Asciidoctor PDF, which must read the image in order to embed it.

The current workaround for this situation in Asciidoctor Diagram is to use an absolute path as the image target if the data-uri attribute is set on the document. See:

Since setting the data-uri has other implications, we may decide to settle on a different attribute name.

Since we plan to add support for the imagesdir on the image node in core (see asciidoctor/asciidoctor#3660), one approach is to rely on that enhancement and set the imagesdir attribute on the generated node if it differs from the normal location. That way, the converter doesn't have to do any extra work.

@mojavelinux mojavelinux changed the title Fetched diagram cannot be located if image output directory does not match imagesdir Converter cannot locate fetched diagram if image output directory does not match imagesdir Jun 4, 2022
@mojavelinux
Copy link
Member Author

@ggrossetie
Copy link
Member

@mojavelinux should we anticipate this change and set the imagesdir attribute on the generated node today?

Since we plan to add support for the imagesdir on the image node in core (see asciidoctor/asciidoctor#3660), one approach is to rely on that enhancement and set the imagesdir attribute on the generated node if it differs from the normal location. That way, the converter doesn't have to do any extra work.

So, if imagesoutdir is specified we should set the imagesdir attribute on the generated node? Maybe we should always set the imagesdir on the generated node?

@mojavelinux
Copy link
Member Author

Yes, I'm confident that we can add the check for imagesdir on the node in 2.1. I'll revive asciidoctor/asciidoctor#3661

Maybe we should always set the imagesdir on the generated node?

Can't hurt, esp since this is essentially an internal negotiation with the converter.

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

No branches or pull requests

2 participants