Closed jgm closed 8 years ago
Line 536 of the ICML writer uses pathSeparator - could it just as well use /
?
Then the test output would not vary with OS.
The pathSeparator was added in 9deb335c. I think it can be removed safely, or we can use Posix.pathSeparator as we do in Shared.
@mb21 this was your code, according to the commit message. Any ideas?
According to this, one should never get something like file://./lalune.jpg
, let alone file://.\lalune.jpg
.
Do we need the file://
? If so, should we get the absolute path to the file and insert that? Finally, can we use posix separators (/
)?
Interestingly, in the ICML spec they have examples like "file:D:/images/pumpkin.jpg"
without the //
. Looks like forward slashes are fine.
It was "file:" ++ src
before 9deb335ca5fbf9f1db0cd1d046d2b59a9a5a55fe, where I changed it to "file://." ++ pathSeparator : src
and if I remember correctly, the reason was that relative paths didn't work before. This is not well documented, but seems to be the only way in IDML, even if it's not RFC 3986 conform.
btw, you can get a free trial of InDesign or InCopy...
But maybe we should use file:
for absolute paths and "file://./" ++ src
for relative ones (it's possible that this would work for Windows as well, I don't have a Windows install handy..)
Actually I just tried "file:foo.jpg"
and "file:/Users/myuser/foo.jpg"
on InCopy CS6 and InDesign CC 2015 on Mac OS X and both worked. So not quite sure what's changed, but you can disregard what I said before...
OK, thanks - so what I have now in head is okay, then?
+++ Mauro Bieg [Dec 14 15 07:01 ]:
Actually I just tried "file:foo.jpg" and "file:/Users/myuser/foo.jpg" on InCopy CS6 and InDesign CC 2015 on Mac OS X and both worked. So not quite sure what's changed, but you can disregard what I said before...
— Reply to this email directly or [1]view it on GitHub.
References
yes, at least on a Mac it works, but from the example you posted ("file:D:/images/pumpkin.jpg"
), I'm fairly confident it works on Windows as well.
Great.
+++ Mauro Bieg [Dec 14 15 08:34 ]:
yes, at least on a Mac it works, but from the example you posted ("file:D:/images/pumpkin.jpg"), I'm fairly confident it works on Windows as well.
— Reply to this email directly or [1]view it on GitHub.
References