summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/PsSpecialHandler.cpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-03-11 03:01:57 +0000
committerNorbert Preining <norbert@preining.info>2023-03-11 03:01:57 +0000
commit6d29701d91e7deb368e3829e1ff11dcf483cd2fb (patch)
tree48b99cc0de5eddd0e49f8a6d0e5f515763b408f5 /dviware/dvisvgm/src/PsSpecialHandler.cpp
parentf6cb3d263826846efe7b926e6ad2092198db0522 (diff)
CTAN sync 202303110301
Diffstat (limited to 'dviware/dvisvgm/src/PsSpecialHandler.cpp')
-rw-r--r--dviware/dvisvgm/src/PsSpecialHandler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/dviware/dvisvgm/src/PsSpecialHandler.cpp b/dviware/dvisvgm/src/PsSpecialHandler.cpp
index 7645adea02..5dfdfc0852 100644
--- a/dviware/dvisvgm/src/PsSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/PsSpecialHandler.cpp
@@ -422,17 +422,17 @@ PsSpecialHandler::ImageNode PsSpecialHandler::createBitmapNode (const string &fn
imgnode.element->addAttribute("y", 0);
imgnode.element->addAttribute("width", bbox.width());
imgnode.element->addAttribute("height", bbox.height());
-
- // Only reference the image with an absolute path if either an absolute path was given by the user
- // or a given plain filename is not present in the current working directory but was found through
- // the FileFinder, i.e. it's usually located somewhere in the texmf tree.
- string href = path;
- if (!FilePath::isAbsolute(fname) && (fname.find('/') != string::npos || FilePath(fname).exists()))
- href = FilePath(path).relative(FilePath(_actions->getSVGFilePath(pageno)));
if (EMBED_BITMAP_DATA)
imgnode.element->addAttribute("@@xlink:href", "data:" + util::mimetype(fname) + ";base64," + fname);
- else
+ else {
+ string href = path;
+ // Only reference the image with an absolute path if either an absolute path was given by the user
+ // or a given plain filename is not present in the current working directory but was found through
+ // the FileFinder, i.e. it's usually located somewhere in the texmf tree.
+ if (!FilePath::isAbsolute(fname) && (fname.find('/') != string::npos || FilePath(fname).exists()))
+ href = FilePath(path).relative(FilePath(_actions->getSVGFilePath(pageno)));
imgnode.element->addAttribute("xlink:href", href);
+ }
return imgnode;
}