mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 10:17:02 -06:00
SVG import checks each linked image's path with craft-docpath, and two of its results were wrong, most visibly on Windows. A missing image's link kept the path that craft-docpath returned, with its separators rewritten: an href of /abs/photo.png became \abs\photo.png on Windows, and SVG export with linked images writes that back as the href. A folder that is not absolute, such as /tmp on Windows or a relative folder on any system, made each relative href, and on Windows each href rooted without a drive, resolve to a path that is not absolute, so those images were not read. Two vectorcraft-svg tests failed on Windows because of this. A link now keeps the href as written (decoded) when the href resolves to the same path without the SVG's folder, and keeps the path found when it needs the folder: a relative path, or on Windows a path rooted without a drive. A file: URL keeps the path it names. The folder is made absolute against the working directory when it is not, as the engine's reader does with the document's path. Hrefs that were refused are still refused: paths on other computers, devices and URLs are not read.