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

apply resolve-dir only to relative path names #16

Open
bertsky opened this issue Oct 29, 2020 · 2 comments
Open

apply resolve-dir only to relative path names #16

bertsky opened this issue Oct 29, 2020 · 2 comments

Comments

@bertsky
Copy link

bertsky commented Oct 29, 2020

The current implementation of the --resolve-dir option prefixes an image path passed on the command line unconditionally:

if (imageFilePath != null && resolveDir != null)
imageFilePath = resolveDir + (resolveDir.endsWith(File.separator) ? "" : File.separator) + imageFilePath;

This is not correct IMHO: On the command line, relative paths should resolve to the CWD, and absolute paths should not be prefixed by anything.

In contrast, image paths parsed from the XML are already prefixed correctly:

if (page.getImageFilename() != null
&& (page.getImageFilename().startsWith("/") || page.getImageFilename().contains(":"))
&& new File(page.getImageFilename()).exists()) {

@chris1010010
Copy link
Contributor

Seems reasonable. Do you have something I can put in? I don't have access to the office at the moment and don't have Eclipse set up at home. Remote desktop is sluggish and I can only do minimal tasks

@bertsky
Copy link
Author

bertsky commented May 25, 2023

see 6e63acb

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