Skip to content

apply resolve-dir only to relative path names #16

@bertsky

Description

@bertsky

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()) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions